File tree 1 file changed +30
-0
lines changed
SimpleWeather.Common/Migrations
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,36 @@ internal static async Task PerformVersionMigrations(SQLiteAsyncConnection weathe
143
143
}
144
144
}
145
145
}
146
+ // v5.8.0
147
+ // Clear image cache due to file path change
148
+ // Windows: unregister all bg tasks
149
+ if ( SettingsMgr . VersionCode < 5801 )
150
+ {
151
+ var ImageDataContainer = new Preferences . SettingsContainer ( "images" ) ;
152
+ ImageDataContainer . Clear ( ) ;
153
+
154
+ #if WINDOWS || WINUI
155
+ try
156
+ {
157
+ var tasks = Windows . ApplicationModel . Background . BackgroundTaskRegistration . AllTasks ;
158
+
159
+ foreach ( var task in tasks )
160
+ {
161
+ try
162
+ {
163
+ task . Value . Unregister ( true ) ;
164
+
165
+ AnalyticsLogger . LogEvent ( "BGTasks: unregistered task" , new Dictionary < string , string > ( )
166
+ {
167
+ { "task" , task . Value . Name } ,
168
+ } ) ;
169
+ }
170
+ catch { }
171
+ }
172
+ }
173
+ catch { }
174
+ #endif
175
+ }
146
176
#if ! UNIT_TEST
147
177
if ( SettingsMgr . VersionCode < CurrentVersionCode )
148
178
{
You can’t perform that action at this time.
0 commit comments