There was an error while loading. Please reload this page.
1 parent e2b2f50 commit e9de584Copy full SHA for e9de584
1 file changed
client/js/helpers/uri.ts
@@ -47,6 +47,8 @@ export function filterTypeToString(type: FilterType): string {
47
return 'unread';
48
} else if (type == FilterType.STARRED) {
49
return 'starred';
50
+ } else {
51
+ throw new Error(`Invalid filter type: “${type}”`);
52
}
53
54
@@ -70,6 +72,13 @@ export function useEntriesParams(): Params | null {
70
72
71
73
74
const { params } = match;
75
+
76
+ if (!params.filter || !params.category) {
77
+ // Note: it isn't possible to reach this part of the code
78
+ // This is to keep the TypeScript compiler happy
79
+ return null;
80
+ }
81
82
const filterValid = /^(newest|unread|starred)$/.test(params.filter);
83
const categoryValid = /^(all|tag-.+|source-[0-9]+)$/.test(params.category);
84
const idValid = params.id === undefined || /^\d+$/.test(params.id);
0 commit comments