|
@@ -96,6 +96,12 @@
|
|
|
NSString *downloadTHMPath = [rootPath stringByAppendingFormat:@"/ThemeResources/%@.thm", themeId];
|
|
|
NSString *extractPath = [rootPath stringByAppendingFormat:@"/ThemeResources/%@", themeId];
|
|
|
self.downloadBlock(themeId, downloadTHMPath, ^(BOOL success, NSString * _Nonnull reason) {
|
|
|
+ if (!success) {
|
|
|
+ if (completion) {
|
|
|
+ completion(NO, reason, nil);
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
BOOL extractSuccess = [SSZipArchive unzipFileAtPath:downloadTHMPath toDestination:extractPath uniqueId:nil];
|
|
|
[NSFileManager.defaultManager removeItemAtPath:downloadTHMPath error:nil];
|
|
|
if (!extractSuccess) {
|
|
@@ -128,7 +134,7 @@
|
|
|
}
|
|
|
|
|
|
- (void)applyTheme:(XCThemeSpecModel *)localSpec {
|
|
|
-
|
|
|
+ XCThemeManager.shared.selectedTheme = localSpec.wrappedObject;
|
|
|
}
|
|
|
|
|
|
@end
|