mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 04:55:39 +02:00
do not restore from db if previous restore point exist when launch pw
This commit is contained in:
parent
806fcd6bd2
commit
2b36e580b9
1 changed files with 17 additions and 1 deletions
|
@ -328,6 +328,22 @@ namespace PersistentWindows.Common
|
|||
return false;
|
||||
}
|
||||
|
||||
private bool RestoreExists(string displayKey)
|
||||
{
|
||||
if (!snapshotTakenTime.ContainsKey(displayKey))
|
||||
return false;
|
||||
|
||||
foreach (var id in snapshotTakenTime[displayKey].Keys)
|
||||
{
|
||||
// 26 + 10 maximum manual snapshots
|
||||
// + last auto restore, + last snapshot restore
|
||||
if (id < MaxSnapshots)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Start(bool auto_restore_from_db = false)
|
||||
{
|
||||
process = Process.GetCurrentProcess();
|
||||
|
@ -896,7 +912,7 @@ namespace PersistentWindows.Common
|
|||
dbDisplayKey = curDisplayKey;
|
||||
StartRestoreTimer();
|
||||
}
|
||||
else if (db_exist && autoRestoreLiveWindows)
|
||||
else if (db_exist && autoRestoreLiveWindows && !RestoreExists(curDisplayKey))
|
||||
{
|
||||
Log.Event("auto restore from db");
|
||||
restoringFromDB = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue