Skip to content

Commit 3e15a7a

Browse files
committed
enabled backup reminder
1 parent a37cd6c commit 3e15a7a

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

Spixi/Meta/Config.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,7 @@ public class Config
5959
public static readonly int VoIP_sampleRate = 16000;
6060
public static readonly int VoIP_bitRate = 16;
6161
public static readonly int VoIP_channels = 1;
62+
63+
public static readonly long backupReminder = 86400 * 30; // 1 month
6264
}
6365
}

Spixi/Pages/Home/HomePage.xaml.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,13 +1038,23 @@ void addPaymentActivity(Transaction tx)
10381038
}
10391039
}
10401040

1041-
1041+
private void displayBackupReminder()
1042+
{
1043+
if (!Preferences.Default.ContainsKey("backupReminderTimestamp")
1044+
|| Clock.getTimestamp() - long.Parse(Preferences.Default.Get("backupReminderTimestamp", "").ToString()) > Config.backupReminder)
1045+
{
1046+
Utils.sendUiCommand(this, "toggleAnimatedSlider", "backup-prompt");
1047+
Preferences.Default.Set("backupReminderTimestamp", Clock.getTimestamp().ToString());
1048+
}
1049+
}
10421050

10431051
// Executed every second
10441052
public override void updateScreen()
10451053
{
10461054
base.updateScreen();
10471055

1056+
displayBackupReminder();
1057+
10481058
loadApps();
10491059
loadChats();
10501060
loadContacts();

Spixi/Resources/Raw/html/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@
232232

233233
</div> <!-- Wrap -->
234234

235-
<!--TODO: needs proper logic when to show -->
236235
<div class="action-slide-up-container" id="backup-prompt">
237236
<div class="backup-prompt-icon-container">
238237
<i class="fas fa-folder-closed backupIcon"></i>
@@ -242,7 +241,7 @@
242241
<span class="body-sm s-text-01">*SL{index-backup-prompt-desc}</span>
243242
</div>
244243
<div class="add-mini-app-buttons">
245-
<div class="spixi-flat-button label-sm" onclick="confirmInstallCall()">
244+
<div class="spixi-flat-button label-sm" onclick="window.location.href='ixian:backup'">
246245
*SL{index-backup-prompt-create}
247246
</div>
248247
<div class="spixi-flat-button label-sm button outline" onclick="toggleAnimatedSlider('backup-prompt')">

Spixi/Resources/Raw/html/js/spixi.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,20 @@ function parseBoolean(value) {
319319

320320
function toggleAnimatedSlider(elementId) {
321321
const slideUpContainer = document.getElementById(elementId);
322+
const toolbarEl = document.getElementById("toolbar");
322323

323324
if (slideUpContainer.classList.contains('active')) {
324325
slideUpContainer.classList.remove('active');
325326
document.getElementById("wrap").classList.remove("blurredContent");
326-
document.getElementById("toolbar").classList.remove("blurredContent");
327+
if (toolbarEl != null) {
328+
toolbarEl.classList.remove("blurredContent");
329+
}
327330
} else {
328331
slideUpContainer.classList.add('active');
329332
document.getElementById("wrap").classList.add("blurredContent");
330-
document.getElementById("toolbar").classList.add("blurredContent");
333+
if (toolbarEl != null) {
334+
toolbarEl.classList.add("blurredContent");
335+
}
331336
}
332337
}
333338

0 commit comments

Comments
 (0)