diff --git a/app/js/login/login.js b/app/js/login/login.js index 0afeb97a..605b4103 100644 --- a/app/js/login/login.js +++ b/app/js/login/login.js @@ -286,7 +286,7 @@ function getdataAdv(domain, at) { } var multi = localStorage.getItem('multi') var obj = JSON.parse(multi) - var target = obj.lengtth + var target = obj.length obj.push(add) localStorage.setItem('name_' + target, json['display_name']) localStorage.setItem('user_' + target, json['acct']) @@ -307,8 +307,13 @@ async function refresh(target, loadskip) { let at = obj[target].at if (obj[target].rt) { console.log('refresh access token') - at = await refreshPleromaAt(obj[target]) - localStorage.setItem(`acct_${target}_at`, at) + const atk = await refreshPleromaAt(obj[target]) + if (atk) { + at = atk + localStorage.setItem(`acct_${target}_at`, at) + obj[target].at = at + localStorage.setItem(`multi`, JSON.stringify(obj)) + } } var start = 'https://' + obj[target].domain + '/api/v1/accounts/verify_credentials' fetch(start, { @@ -384,13 +389,13 @@ async function refreshPleromaAt(obj) { 'content-type': 'application/json' }, body: JSON.stringify({ - grant_type : 'refresh_token', + grant_type: 'refresh_token', refresh_token: rt[0], client_id: rt[1], client_secret: rt[2] }) }) - + const json = await promise.json() if (json.access_token) { return json.access_token diff --git a/app/js/tl/datails.js b/app/js/tl/datails.js index de76a427..41144e82 100644 --- a/app/js/tl/datails.js +++ b/app/js/tl/datails.js @@ -5,6 +5,12 @@ function details(id, acct_id, tlid, mode) { } else { $('.dm-hide').show() } + const context = localStorage.getItem('moreContext') + if(context != 'yes') { + $('.contextTool').hide() + } else { + $('.contextTool').show() + } $('.toot-reset').html('' + lang.lang_details_nodata + '') var html = $('#timeline_' + tlid + ' [toot-id=' + id + ']').html() $('#toot-this').html(html) @@ -222,6 +228,10 @@ function getContext(id, acct_id) { var templete = parse(json.descendants, '', acct_id, '', '', mute) if (templete != '') { $('#toot-after .no-data').hide() + $('#toot-after-new').removeClass('hide') + } else { + $('#toot-after-new').addClass('hide') + $('#toot-after').html('' + lang.lang_details_nodata + '') } $('#toot-after').html(templete) $('#toot-after .hide').html(lang.lang_details_filtered) @@ -230,6 +240,9 @@ function getContext(id, acct_id) { var templete = parse(json.ancestors, '', acct_id, '', '', mute) if (templete != '') { $('#toot-reply .no-data').hide() + $('#toot-reply-new').removeClass('hide') + } else { + $('#toot-reply-new').addClass('hide') } $('#toot-reply').prepend(templete) $('#toot-reply .hide').html(lang.lang_details_filtered) diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 45ff8cf6..e6109195 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -1563,7 +1563,7 @@ function mastodonBaseStreaming(acct_id) { const at = localStorage.getItem(`acct_${acct_id}_at`) let wss = 'wss://' + domain if (localStorage.getItem('streaming_' + acct_id)) { - wss = localStorage.getItem('streaming_' + acct_id) + wss = localStorage.getItem('streaming_' + acct_id).replace('https://', 'wss://') } const start = `${wss}/api/v1/streaming/?access_token=${at}` mastodonBaseWs[domain] = new WebSocket(start) diff --git a/app/js/tl/tl.js b/app/js/tl/tl.js index 6d56a72b..4398017e 100644 --- a/app/js/tl/tl.js +++ b/app/js/tl/tl.js @@ -299,7 +299,7 @@ function oldStreaming(type, cc, acct_id, tlid, data, mute, delc, voice, mode) { const domain = localStorage.getItem(`domain_${acct_id}`) var at = localStorage.getItem('acct_' + acct_id + '_at') if (localStorage.getItem('streaming_' + acct_id)) { - var wss = localStorage.getItem('streaming_' + acct_id) + var wss = localStorage.getItem('streaming_' + acct_id).replace('https://', 'wss://') } else { var wss = 'wss://' + domain } diff --git a/app/js/ui/settings.js b/app/js/ui/settings.js index bb2ad757..fc79695a 100644 --- a/app/js/ui/settings.js +++ b/app/js/ui/settings.js @@ -4,13 +4,18 @@ var envView = new Vue({ data: { config: envConstruction }, methods: { complete: function (i, val) { - var ls = envView.config[i].storage - M.toast({ html: 'Complete', displayLength: 3000 }) - if (!val) { - var id = envView.config[i].id - var val = $('#' + id).val() + var ls = envView.config[i] + if (!ls.data) { + ls = [ls] + } else { + ls = ls.data + } + for (var j = 0; j < ls.length; j++) { + M.toast({ html: 'Complete', displayLength: 3000 }) + var id = ls[j].id + var val = $('#' + id).val() + localStorage.setItem(ls[j].storage, val) } - localStorage.setItem(ls, val) if (ls == 'ha') { hardwareAcceleration(val) } @@ -105,8 +110,15 @@ function load() { var max = envView.config.length for (var i = 0; i < max; i++) { var ls = envView.config[i].storage - if (localStorage.getItem(ls)) { - envView.config[i].setValue = localStorage.getItem(ls) + if (ls) { + if (localStorage.getItem(ls)) { + envView.config[i].setValue = localStorage.getItem(ls) + } + } else { + ls = envView.config[i].data + for (var j = 0; j < ls.length; j++) { + envView.config[i].data[j].setValue = localStorage.getItem(ls[j].storage) + } } } var max = tlView.config.length diff --git a/app/package.json b/app/package.json index 9d89ea05..6e584044 100644 --- a/app/package.json +++ b/app/package.json @@ -61,16 +61,16 @@ "dependencies": { "@fortawesome/fontawesome-free": "^5.15.2", "@syuilo/aiscript": "^0.11.1", - "electron-dl": "^3.0.2", + "electron-dl": "^3.2.1", "jimp": "^0.16.1", - "jquery": "^3.5.1", + "jquery": "^3.6.0", "jquery-ui-dist": "^1.12.1", "json5": "^2.2.0", "lodash": "^4.17.21", "materialize-css": "git://github.com/cutls/materialize#v1-dev", "sanitize-html": "^2.3.2", "sumchecker": "^3.0.1", - "sweetalert2": "^10.14.0", + "sweetalert2": "^10.15.7", "system-font-families": "^0.4.1", "vue": "^2.6.12" }, @@ -83,7 +83,7 @@ "electron": "^10.1.5", "electron-builder": "^22.9.1", "electron-rebuild": "^2.3.2", - "eslint": "^7.13.0", + "eslint": "^7.23.0", "readline-sync": "1.4.10" }, "build": { diff --git a/app/view/make/index.sample.html b/app/view/make/index.sample.html index 3d613dd1..01bb346f 100644 --- a/app/view/make/index.sample.html +++ b/app/view/make/index.sample.html @@ -390,25 +390,26 @@