Clear extensions cache after extension repos change (#555)
This will force a refetch of the extensions the next time the list gets opened which will update the extensions on the server
This commit is contained in:
@@ -380,6 +380,10 @@ export class RequestManager {
|
|||||||
this.cache.clearFor(...cacheKeys);
|
this.cache.clearFor(...cacheKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public clearExtensionCache() {
|
||||||
|
this.cache.clearFor(this.cache.getKeyFor(EXTENSION_LIST_CACHE_KEY, undefined));
|
||||||
|
}
|
||||||
|
|
||||||
private createAbortController(): { signal: AbortSignal } & AbortableRequest {
|
private createAbortController(): { signal: AbortSignal } & AbortableRequest {
|
||||||
const abortController = new AbortController();
|
const abortController = new AbortController();
|
||||||
const abortRequest = (reason?: any): void => {
|
const abortRequest = (reason?: any): void => {
|
||||||
|
|||||||
@@ -144,7 +144,10 @@ export const ServerSettings = () => {
|
|||||||
You as the user need to verify the security and that you trust any repository or extension.
|
You as the user need to verify the security and that you trust any repository or extension.
|
||||||
</Trans>
|
</Trans>
|
||||||
}
|
}
|
||||||
handleChange={(repos) => updateSetting('extensionRepos', repos)}
|
handleChange={(repos) => {
|
||||||
|
updateSetting('extensionRepos', repos);
|
||||||
|
requestManager.clearExtensionCache();
|
||||||
|
}}
|
||||||
values={serverSettings?.extensionRepos}
|
values={serverSettings?.extensionRepos}
|
||||||
addItemButtonTitle={t('extension.settings.repositories.custom.dialog.action.button.add')}
|
addItemButtonTitle={t('extension.settings.repositories.custom.dialog.action.button.add')}
|
||||||
placeholder="https://github.com/MY_ACCOUNT/MY_REPO/tree/repo"
|
placeholder="https://github.com/MY_ACCOUNT/MY_REPO/tree/repo"
|
||||||
|
|||||||
Reference in New Issue
Block a user