diff --git a/electron/index3.html b/electron/index3.html
index 1ce605f..905c55e 100644
--- a/electron/index3.html
+++ b/electron/index3.html
@@ -92,6 +92,7 @@
const superagent = require('superagent');
const path = require('path');
const fs = require('fs');
+ const crypto = require('crypto')
const Login = require('../modules/login');
const shell = require('electron').shell
@@ -377,6 +378,8 @@
',
});
+
+ var userAccordionHolder;
Vue.component('user-accordion', {
data: function() {
return {
@@ -398,7 +401,7 @@
\
\
\
\
+
Remove last.fm account\
+
Add last.fm account\
\
Reset Password\
Edit\
@@ -417,12 +422,20 @@
\
',
mounted: function () {
+ userAccordionHolder = this;
this.instances = M.Collapsible.init(document.querySelectorAll('.collapsible-folders'), { onCloseEnd: this.closeOverride });
},
beforeDestroy: function() {
+ userAccordionHolder = null;
this.instances[0].destroy();
},
methods: {
+ displayName: function(arr) {
+ if(arr['lastfm-user']) {
+ return ' (last.fm: ' + arr['lastfm-user'] + ')';
+ }
+ return '';
+ },
folderList: function(arr) {
var returnThis = '';
arr.forEach((element) => {
@@ -473,6 +486,40 @@
]
});
},
+ openLastFmModal: function(value, key, index) {
+ editThisUser = key;
+ if (vModal.$children[0]) {
+ vModal.componentKey = !vModal.componentKey;
+ }
+ vModal.currentViewModal = 'user-lastfm-view';
+ modalInstance[0].open();
+ },
+ removeLastFmUser: function(value, key, index) {
+ iziToast.question({
+ timeout: 20000,
+ close: false,
+ overlayClose: true,
+ overlay: true,
+ displayMode: 'once',
+ id: 'question',
+ zindex: 99999,
+ title: "Remove last.fm login for
'" + key + "'?",
+ position: 'center',
+ buttons: [
+ ['
', (instance, toast) => {
+ loadJson.users[key]['lastfm-user'] = undefined;
+ loadJson.users[key]['lastfm-password'] = undefined;
+ fs.writeFileSync(configFile, JSON.stringify(loadJson), 'utf8');
+ // this.instances[0].close(index);
+ instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
+ this.$forceUpdate()
+ }, true],
+ ['
', (instance, toast) => {
+ instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
+ }],
+ ]
+ });
+ },
toggleOptions: function(index, el) {
if(el.target.classList.contains('btn')){
return;
@@ -526,6 +573,7 @@
\
\
\
+ \
\
\
\