From e46714e0f9577561b57a313e388e98667385e974 Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Wed, 31 Jul 2024 02:31:13 +0100 Subject: [PATCH] Fixed: - Remote Storage Limit Notification dialogue has been fixed, now the chosen value is saved. Improved: - The Enlarging button on the enlarging threshold dialogue now displays the new value. --- src/main.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index cff9d4c..a8322c2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -663,10 +663,13 @@ And if your actual storage size exceeds the threshold after the setup, you may w const ret = await confirmWithMessage(this, "Remote storage size threshold", message, [ANSWER_0, ANSWER_800, ANSWER_2000], ANSWER_800, 40); if (ret == ANSWER_0) { this.settings.notifyThresholdOfRemoteStorageSize = 0; + await this.saveSettings(); } else if (ret == ANSWER_800) { this.settings.notifyThresholdOfRemoteStorageSize = 800; + await this.saveSettings(); } else { this.settings.notifyThresholdOfRemoteStorageSize = 2000; + await this.saveSettings(); } } if (this.settings.notifyThresholdOfRemoteStorageSize > 0) { @@ -686,7 +689,8 @@ If you have enough space on the remote storage, you can enlarge the threshold. O However, **Please make sure that all devices have been synchronised**. \n \n`; - const ANSWER_ENLARGE_LIMIT = "Enlarge the limit"; + const newMax = ~~(estimatedSize / 1024 / 1024) + 100; + const ANSWER_ENLARGE_LIMIT = `Enlarge to ${newMax}MB`; const ANSWER_REBUILD = "Rebuild now"; const ANSWER_IGNORE = "Dismiss"; const ret = await confirmWithMessage(this, "Remote storage size exceeded", message, [ANSWER_ENLARGE_LIMIT, ANSWER_REBUILD, ANSWER_IGNORE,], ANSWER_IGNORE, 20); @@ -708,7 +712,7 @@ However, **Please make sure that all devices have been synchronised**. \n // Dismiss or Close the dialog } - Logger(`Remote storage size: ${sizeToHumanReadable(estimatedSize)} exceeded ${sizeToHumanReadable(this.settings.notifyThresholdOfRemoteStorageSize)} `, LOG_LEVEL_INFO); + Logger(`Remote storage size: ${sizeToHumanReadable(estimatedSize)} exceeded ${sizeToHumanReadable(this.settings.notifyThresholdOfRemoteStorageSize * 1024 * 1024)} `, LOG_LEVEL_INFO); } else { Logger(`Remote storage size: ${sizeToHumanReadable(estimatedSize)}`, LOG_LEVEL_INFO); }