Skip to content

Commit 2fe0c88

Browse files
committed
fixup pat-toolbar: Remove the render URL cleanup method. This is now done directly in pat-base-url.
1 parent 0b35817 commit 2fe0c88

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

src/pat/toolbar/toolbar.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Pattern extends BasePattern {
3232
"navigate",
3333
"pat-toolbar--history-changed",
3434
async () => {
35-
// Wait a tick to let other Patterns set the baseUrl.
35+
// Wait a tick to let other Patterns set the `data-base-url`.
3636
await utils.timeout(1);
3737
await this.reload_toolbar();
3838
}
@@ -60,23 +60,11 @@ class Pattern extends BasePattern {
6060
}
6161

6262
async reload_toolbar() {
63-
// Don't reload on content views but on their parent if so.
64-
const split_words = [
65-
// NOTE: order matters.
66-
"@@", // also catches @@folder_contents and @@edit
67-
"folder_contents",
68-
"edit",
69-
"#",
70-
"?",
71-
];
63+
const render_url = this.options["render-url"];
7264
let url = document.body.dataset.baseUrl;
73-
log.debug("URL before cleanup: ", url);
74-
// Split all split words out of url
75-
url = split_words.reduce((url_, split_) => url_.split(split_)[0], url);
7665
// Ensure a trailing slash in the URL.
7766
url = url[url.length - 1] === "/" ? url : `${url}/`
78-
url = `${url}${this.options["render-url"]}`;
79-
log.debug("URL after cleanup: ", url);
67+
url = `${url}${render_url}`;
8068

8169
if (this.previous_toolbar_url === url) {
8270
// no need to reload same url
@@ -85,6 +73,7 @@ class Pattern extends BasePattern {
8573
}
8674

8775
// fetch toolbar
76+
log.debug("Reload toolbar on: ", url);
8877
const response = await fetch(url);
8978
const data = await response.text();
9079

0 commit comments

Comments
 (0)