fix: Sync time is updated even if upload failed

This commit is contained in:
Peng-YM
2022-07-08 10:26:05 +08:00
parent 2ee515dc23
commit b1d811e4c5
6 changed files with 26 additions and 14 deletions

View File

@@ -62,8 +62,10 @@ async function updateArtifactStore() {
try {
const gistId = await manager.locate();
settings.artifactStore = `https://gist.github.com/${githubUser}/${gistId}`;
$.write(settings, SETTINGS_KEY);
if (gistId !== -1) {
settings.artifactStore = `https://gist.github.com/${githubUser}/${gistId}`;
$.write(settings, SETTINGS_KEY);
}
} catch (err) {
$.error('Failed to fetch artifact store for User: ' + githubUser);
}