Skip to content

Commit af19e02

Browse files
authored
fix(EasyArchive): handle targetPage conditionally in refresh() (qiuwenbaike#1771)
* fix(EasyArchive): handle targetPage conditionally in refresh()
1 parent e2b378b commit af19e02

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

dist/EasyArchive/EasyArchive.js

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/EasyArchive/modules/util/refreshPage.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ const refresh = ({
1717
'success'
1818
);
1919

20-
const {wgPageName} = mw.config.get();
21-
location.replace(mw.util.getUrl(targetPage ?? wgPageName));
20+
if (targetPage) {
21+
location.replace(mw.util.getUrl(targetPage));
22+
} else {
23+
location.reload();
24+
}
2225
};
2326

2427
export {refresh};

0 commit comments

Comments
 (0)