Fix being unable to delete savegames when it was deleted before, minor adjustments
This commit is contained in:
parent
690483fd89
commit
7797546ed4
|
@ -148,6 +148,7 @@
|
|||
color: #333;
|
||||
@include S(margin-top, 15px);
|
||||
@include SuperSmallText;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.steamLink {
|
||||
|
|
|
@ -5,6 +5,7 @@ export const CHANGELOG = [
|
|||
entries: [
|
||||
"Reworked the tutorial to be simpler and more interactive",
|
||||
"General polishing",
|
||||
"Fix being unable to delete savegame when the savegame file was deleted externally",
|
||||
"Updated translations",
|
||||
],
|
||||
},
|
||||
|
|
|
@ -99,17 +99,22 @@ export class SavegameManager extends ReadWriteProxy {
|
|||
metaDataRef: game,
|
||||
});
|
||||
|
||||
return handle.deleteAsync().then(() => {
|
||||
for (let i = 0; i < this.currentData.savegames.length; ++i) {
|
||||
const potentialGame = this.currentData.savegames[i];
|
||||
if (potentialGame.internalId === handle.internalId) {
|
||||
this.currentData.savegames.splice(i, 1);
|
||||
break;
|
||||
return handle
|
||||
.deleteAsync()
|
||||
.catch(err => {
|
||||
console.warn("Failed to unlink physical savegame file, still removing:", err);
|
||||
})
|
||||
.then(() => {
|
||||
for (let i = 0; i < this.currentData.savegames.length; ++i) {
|
||||
const potentialGame = this.currentData.savegames[i];
|
||||
if (potentialGame.internalId === handle.internalId) {
|
||||
this.currentData.savegames.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.writeAsync();
|
||||
});
|
||||
return this.writeAsync();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue