core&ui: fix sidebar (#513)

Co-authored-by: panda <panda_dtdyy@outlook.com>
This commit is contained in:
undefinedandpanda authored and GitHub committed 2023-02-12 18:16:18 +08:00
1 parent 254f659f0a
commit c347d36e99
7 files changed
+13 -12

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ export * from './components/dialog';
export * as bus from './bus';
export { default as AnsiUp } from 'ansi_up';
export { default as loadMonaco } from './components/monaco/loader';
export { default as uploadFiles } from './components/upload';
export * as redux from 'react-redux';
export * from './components/zipDownloader';
export { default as $ } from 'jquery';
+1 -1
View File
@@ -68,7 +68,7 @@ export default async function uploadFiles(endpoint = '', files: File[] | FileLis
Notification.success(i18n('File uploaded successfully.'));
if (options.pjax) {
let params = '';
if (options.type) params += `?testdata=${options.type === 'testdata'}&additional_file=${options.type === 'additional_file'}`;
if (options.type) params += `?d=${options.type}`;
if (options.sidebar) params += `${params ? '&' : '?'}sidebar=true`;
await pjax.request({ push: false, url: `${endpoint}${params || ''}` });
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.47.3",
"version": "4.47.4",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "index.ts",
@@ -57,7 +57,7 @@ const page = new NamedPage('problem_config', () => {
type: 'CONFIG_DELETE_TESTDATA',
value: file,
});
await pjax.request({ url: './files?testdata=false&sidebar=true', push: false });
await pjax.request({ url: './files?d=testdata&sidebar=true', push: false });
} catch (error) {
Notification.error(error.message);
}
@@ -214,7 +214,7 @@ export default new NamedPage(['problem_create', 'problem_edit'], (pagename) => {
type: 'additional_file',
});
Notification.success(i18n('File have been deleted.'));
await pjax.request({ url: './files?testdata=false&sidebar=true', push: false });
await pjax.request({ url: './files?d=additional_file&sidebar=true', push: false });
} catch (error) {
Notification.error(error.message);
}