From 1215ec4fff95d20710ef61a562d83d2faededc4f Mon Sep 17 00:00:00 2001 From: Moe Date: Wed, 27 Oct 2021 16:18:52 -0700 Subject: [PATCH] show Max Storage Amount notice on login if set to lower than 20GB --- languages/en_CA.json | 1 + web/assets/js/bs5.startup.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/languages/en_CA.json b/languages/en_CA.json index 515081eb..de3cc094 100644 --- a/languages/en_CA.json +++ b/languages/en_CA.json @@ -1246,5 +1246,6 @@ "Backup": "Backup", "Close All Monitors": "Close All Monitors", "Daily Events": "Daily Events", + "setMaxStorageAmountText": "You should set your Max Storage Amount in your Account Settings located on the left. Find the option under the Profile section. It is currently set to 10 GB.", "Cloud": "Cloud" } diff --git a/web/assets/js/bs5.startup.js b/web/assets/js/bs5.startup.js index 7e1bbf23..6ff9072c 100644 --- a/web/assets/js/bs5.startup.js +++ b/web/assets/js/bs5.startup.js @@ -99,6 +99,22 @@ function drawAddStorageIndicators(){ } }) } +function showLoginNotices(){ + $.each([ + { + isValid: !$user.details.size || parseInt($user.details.size) < 20000, + PNotify: { + type:'warning', + title: lang['Max Storage Amount'], + text: lang.setMaxStorageAmountText, + } + } + ],function(n,notice){ + if(notice.isValid){ + new PNotify(notice.PNotify) + } + }) +} $('body') .one('click',function(){ window.hadFocus = true @@ -197,6 +213,7 @@ $(document).ready(function(){ loadLocalStorageInputValues() loadBoxWrappers() drawAddStorageIndicators() + showLoginNotices() // set onFullScreenChange document.addEventListener("fullscreenchange", onFullScreenChange, false); document.addEventListener("webkitfullscreenchange", onFullScreenChange, false);