Skip to content

Commit a98f7c9

Browse files
authored
Remove legacy support for 2.X (#65)
* Remove legacy support for 2.X * Fix bad merge
1 parent d40cee7 commit a98f7c9

File tree

6 files changed

+6
-30
lines changed

6 files changed

+6
-30
lines changed

src/app/services/bookmark.service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Injectable } from '@angular/core';
22
import { StorageService } from '../services/storage.service';
33

4-
const BOOKMARK_FEED_LIST = 'bookmark_feed_list';
4+
const BOOKMARK_FEED_LIST = 'v3_bookmark_feed_list';
55

66
@Injectable({
77
providedIn: 'root'
@@ -30,7 +30,6 @@ export class BookmarkService {
3030
this._bookmarkList.push(entry);
3131
console.log('[BookmarkService] Adding new feed');
3232
this.storageService.set(BOOKMARK_FEED_LIST, this._bookmarkList);
33-
this.feedService.updateBookmarkStatus(entry, true);
3433
}
3534

3635
public removeEntry(entry: string) {
@@ -40,7 +39,6 @@ export class BookmarkService {
4039
this._bookmarkList.splice(index, 1);
4140
}
4241
this.storageService.set(BOOKMARK_FEED_LIST, this._bookmarkList);
43-
this.feedService.updateBookmarkStatus(entry, false);
4442
}
4543

4644
public getBookmarks() {

src/app/services/feed.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { StorageService } from './storage.service';
55
import { SourcesService } from './sources.service';
66
import { ISettingsDict, SettingsService } from './settings.service';
77

8-
const STORAGE_FEED_DATA = 'storage_list_feed_data';
9-
const STORAGE_FEED_DATA_TIMESTAMP = 'storage_list_feed_data_timestamp';
8+
const STORAGE_FEED_DATA = 'v3_storage_list_feed_data';
9+
const STORAGE_FEED_DATA_TIMESTAMP = 'v3_storage_list_feed_data_timestamp';
1010

1111
@Injectable({
1212
providedIn: 'root'

src/app/services/settings.service.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Injectable } from '@angular/core';
22
import { StorageService } from '../services/storage.service';
33

4-
const SETTINGS_DICT = 'settings_dict';
4+
const SETTINGS_DICT = 'v3_settings_dict';
55

66
export interface ISettingsDict {
77
preview: boolean,
@@ -60,11 +60,6 @@ export class SettingsService {
6060
const storage_feed = await this.storageService.getObjectFromStorage(SETTINGS_DICT);
6161

6262
if (storage_feed !== null) {
63-
// Backwards compatible check with <= 2.3.4
64-
if (!Array.isArray(storage_feed.mutedWords)) {
65-
storage_feed.mutedWords = [];
66-
}
67-
6863
this._settingsDict = storage_feed;
6964
}
7065
else

src/app/services/sources.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Subject } from 'rxjs';
88
import { BookmarkService } from './bookmark.service';
99
declare const RSSParser: any;
1010

11-
const STORAGE_FEED_LIST = 'storage_feed_list';
11+
const STORAGE_FEED_LIST = 'v3_storage_feed_list';
1212

1313
export interface IFeedDict {
1414
url: string,

src/app/services/storage.service.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class StorageService {
3838
const storage_item = await this.get(list_name);
3939

4040
if (storage_item !== undefined) {
41-
const storage_item_json = this.legacyParseJson(storage_item);
41+
const storage_item_json = storage_item;
4242

4343
if (storage_item_json !== null) {
4444
return storage_item_json;
@@ -58,13 +58,4 @@ export class StorageService {
5858
}
5959
}
6060

61-
// Support for legacy single encoded values in version before 2.6.0
62-
private legacyParseJson(storage_item: string) {
63-
try {
64-
return JSON.parse(storage_item);
65-
} catch (e) {
66-
console.log('[StorageService] Single encoded value, directly returning:', e);
67-
return storage_item;
68-
}
69-
}
7061
}

src/app/sources/sources.page.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ export class SourcesPage {
7070
}
7171
}
7272

73-
public load() {
74-
this.sourcesService.loadSourcesList();
75-
}
76-
7773
async editUrl(feed: IFeedDict) {
7874
const temp_feed = feed;
7975

@@ -190,8 +186,4 @@ export class SourcesPage {
190186
input.value = '';
191187
}
192188

193-
// removeUrl(url: string) {
194-
// this.sourcesService.removeSource(url);
195-
// }
196-
197189
}

0 commit comments

Comments
 (0)