@@ -89,9 +89,9 @@ export const useFileManagerStore = defineStore('file-manager', () => {
8989 return ;
9090 }
9191
92- const latestManualSnapshot = await snapshots . getLatestManualSnapshot ( ) ;
92+ const latestSnapshotByType = await snapshots . getLatestByType ( snapshot . type ) ;
9393
94- if ( snapshot . type !== 'manual' || ! latestManualSnapshot ) {
94+ if ( ! latestSnapshotByType ) {
9595 snapshots . create ( {
9696 sessionId : currentSession . value . id ,
9797 files : replStore . getFiles ( ) ,
@@ -102,7 +102,7 @@ export const useFileManagerStore = defineStore('file-manager', () => {
102102 sessions . changeUpdatedAt ( currentSession . value . id , new Date ( ) ) ;
103103 }
104104 else {
105- const didFilesChange = replStore . getFiles ( ) [ 'App.vue' ] !== latestManualSnapshot . files [ 'App.vue' ] ;
105+ const didFilesChange = replStore . getFiles ( ) [ 'App.vue' ] !== latestSnapshotByType . files [ 'App.vue' ] ;
106106
107107 if ( didFilesChange ) {
108108 snapshots . create ( {
@@ -113,11 +113,14 @@ export const useFileManagerStore = defineStore('file-manager', () => {
113113 } ) ;
114114
115115 sessions . changeUpdatedAt ( currentSession . value . id , new Date ( ) ) ;
116- toast . success ( 'Snapshot saved' ) ;
116+ if ( snapshot . type === 'manual' ) {
117+ toast . success ( 'Snapshot saved' ) ;
118+ }
117119 }
118120 else {
119- // toast.info('Nothing new to save', { duration: Infinity });
120- toast . info ( 'Nothing new to save' ) ;
121+ if ( snapshot . type === 'manual' ) {
122+ toast . info ( 'Nothing new to save' ) ;
123+ }
121124 }
122125 }
123126 }
0 commit comments