Compare commits

...

1 Commits

2 changed files with 9 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.19.77",
"version": "2.19.78",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {

View File

@@ -120,8 +120,10 @@ async function gistBackupAction(action) {
switch (action) {
case 'upload':
try {
content = $.read('#sub-store');
if ($.env.isNode) content = JSON.stringify($.cache, null, ` `);
content = JSON.parse($.read('#sub-store'));
if ($.env.isNode) content = { ...$.cache };
content.settings.gistToken = '恢复后请重新设置 GitHub Token';
content = JSON.stringify(content, null, ` `);
$.info(`下载备份, 与本地内容对比...`);
const onlineContent = await gist.download(
GIST_BACKUP_FILE_NAME,
@@ -137,8 +139,10 @@ async function gistBackupAction(action) {
// update syncTime
settings.syncTime = new Date().getTime();
$.write(settings, SETTINGS_KEY);
content = $.read('#sub-store');
if ($.env.isNode) content = JSON.stringify($.cache, null, ` `);
content = JSON.parse($.read('#sub-store'));
if ($.env.isNode) content = { ...$.cache };
content.settings.gistToken = '恢复后请重新设置 GitHub Token';
content = JSON.stringify(content, null, ` `);
$.info(`上传备份中...`);
try {
await gist.upload({