Skip to content

Commit 6309673

Browse files
committed
build: Update Node version.
1 parent 02f6478 commit 6309673

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/popup/popup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function applyTheme(theme: string) {
5252

5353
// Load settings
5454
chrome.storage.sync.get(["settings", "theme"], result => {
55-
const settings: Settings = result.settings
55+
const settings = result.settings as Settings | undefined
5656
if (!settings) return
5757

5858
// load input settings

src/storage/get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function get_all_news_channels(): Promise<string[]> {
99

1010
export async function get_news_channel(channel_name: string): Promise<ItemRecord[]> {
1111
const news_channel = await chrome.storage.local.get(`news_channel_${channel_name}`)
12-
return news_channel[`news_channel_${channel_name}`] || []
12+
return news_channel[`news_channel_${channel_name}`] as ItemRecord[] || []
1313
}
1414

1515
export async function get_news_item(

src/storage/revisions/revision_get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import { get_storage_key } from "./common"
44
export async function get_revision(rev_id: string): Promise<RevisionHistoryEntry | null> {
55
const item_name = get_storage_key(rev_id)
66
const result = await chrome.storage.local.get([item_name])
7-
return result[item_name] || null
7+
return result[item_name] as RevisionHistoryEntry || null
88
}

src/storage/set.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export async function add_item_to_channel(channel_name: string, item: ItemRecord
3030
return false
3131
}
3232

33-
const channel_items: ItemRecord[] = channel_data[channel_key] || []
33+
const channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || []
3434

3535
// Check if the item already exists in the channel
3636
const item_exists = channel_items.some(existing_item => existing_item.guid === item.guid)
@@ -59,7 +59,7 @@ export async function update_item_properties(
5959
return
6060
}
6161

62-
let channel_items: ItemRecord[] = channel_data[channel_key] || []
62+
let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || []
6363

6464
// Update the item properties
6565
channel_items = channel_items.map(item => {
@@ -83,7 +83,7 @@ export async function update_item_vc_and_lvt(channel_name: string, item_guid: st
8383
return null
8484
}
8585

86-
let channel_items: ItemRecord[] = channel_data[channel_key] || []
86+
let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || []
8787

8888
// Increment the view count for the specified item
8989
let updated_view_count: number | null = null
@@ -109,7 +109,7 @@ export async function increment_item_bounce_count(channel_name: string, item_gui
109109
return
110110
}
111111

112-
let channel_items: ItemRecord[] = channel_data[channel_key] || []
112+
let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || []
113113

114114
// Increment the bounce count for the specified item
115115
channel_items = channel_items.map(item => {
@@ -132,7 +132,7 @@ export async function add_revision_history_entry(channel_name: string, item_guid
132132
return []
133133
}
134134

135-
let channel_items: ItemRecord[] = channel_data[channel_key] || []
135+
let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || []
136136

137137
// Add the revision ID to the item's revision history
138138
let updated_rev_history: string[] = []
@@ -159,7 +159,7 @@ export async function remove_item_from_channel(channel_name: string, item_guid:
159159
return
160160
}
161161

162-
let channel_items: ItemRecord[] = channel_data[channel_key] || []
162+
let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || []
163163

164164
// Remove the item from the channel
165165
channel_items = channel_items.filter(item => item.guid !== item_guid)
@@ -180,7 +180,7 @@ export async function add_if_not_exists(
180180
return false
181181
}
182182

183-
let channel_items: ItemRecord[] = channel_data[channel_key] || []
183+
let channel_items: ItemRecord[] = channel_data[channel_key] as ItemRecord[] || []
184184

185185
// Check if the item already exists in the channel
186186
const item_exists = channel_items.some(existing_item => existing_item.guid === item_guid)

src/storage/viewed_pages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function add_url_to_recents(url: string, name: string): Promise<voi
1616
url = url.split("#")[0].split("?")[0]
1717

1818
let data = await chrome.storage.local.get(RECENTS_KEY)
19-
let recents: RecentsEntry[] = data[RECENTS_KEY]
19+
let recents: RecentsEntry[] = data[RECENTS_KEY] as RecentsEntry[] || []
2020
const now = Date.now()
2121

2222
let existing_entry: RecentsEntry | undefined = recents.find(entry => entry.url === url)
@@ -46,7 +46,7 @@ export async function get_recents(): Promise<RecentsEntry[]> {
4646
await ensure_recents_exists()
4747

4848
let data = await chrome.storage.local.get(RECENTS_KEY)
49-
let recents: RecentsEntry[] = data[RECENTS_KEY]
49+
let recents: RecentsEntry[] = data[RECENTS_KEY] as RecentsEntry[] || []
5050
return recents
5151
}
5252

0 commit comments

Comments
 (0)