diff options
-rw-r--r-- | source/features/forked-to.tsx | 3 | ||||
-rw-r--r-- | source/features/quick-repo-deletion.tsx | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/source/features/forked-to.tsx b/source/features/forked-to.tsx index b31abb52..8cc72cbd 100644 --- a/source/features/forked-to.tsx +++ b/source/features/forked-to.tsx @@ -12,7 +12,8 @@ import GitHubURL from '../github-helpers/github-url'; import {getUsername, getForkedRepo, getRepo} from '../github-helpers'; const getForkSourceRepo = (): string => getForkedRepo() ?? getRepo()!.nameWithOwner; -const getCacheKey = (): string => `forked-to:${getForkSourceRepo()}@${getUsername()!}`; +// eslint-disable-next-line import/prefer-default-export +export const getCacheKey = (): string => `forked-to:${getForkSourceRepo()}@${getUsername()!}`; const updateCache = cache.function(async (): Promise<string[] | undefined> => { const document = await fetchDom(`/${getForkSourceRepo()}/fork?fragment=1`); diff --git a/source/features/quick-repo-deletion.tsx b/source/features/quick-repo-deletion.tsx index 9ff1dced..89c75a34 100644 --- a/source/features/quick-repo-deletion.tsx +++ b/source/features/quick-repo-deletion.tsx @@ -1,6 +1,7 @@ import './quick-repo-deletion.css'; import delay from 'delay'; import React from 'dom-chef'; +import cache from 'webext-storage-cache'; import select from 'select-dom'; import delegate from 'delegate-it'; import elementReady from 'element-ready'; @@ -11,6 +12,7 @@ import * as api from '../github-helpers/api'; import {getRepo} from '../github-helpers'; import pluralize from '../helpers/pluralize'; import addNotice from '../github-widgets/notice-bar'; +import {getCacheKey} from './forked-to'; import looseParseInt from '../helpers/loose-parse-int'; import parseBackticks from '../github-helpers/parse-backticks'; @@ -103,6 +105,7 @@ async function start(buttonContainer: HTMLDetailsElement): Promise<void> { {action: false}, ); select('.application-main')!.remove(); + await cache.delete(getCacheKey()); if (document.hidden) { // Try closing the tab if in the background. Could fail, so we still update the UI above void browser.runtime.sendMessage({closeTab: true}); |