File tree 3 files changed +6
-4
lines changed
3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 3
3
import ButtonWrapper from ' ./button_wrapper.svelte' ;
4
4
import validateFilename from ' ./validate_filename.js' ;
5
5
6
- export let showAdd, showEditor;
6
+ export let showAdd, showEditor, env ;
7
7
let filename = " " ;
8
+ let baseurl = env .baseurl ? env .baseurl : ' /' ;
8
9
9
10
let selectedType;
10
11
const setType = type => {
16
17
validationErrors = validateFilename (filename, selectedType);
17
18
// No errors, redirect to "add" page
18
19
if (validationErrors .length === 0 ) {
19
- redirectAndEdit (' / #add/' + selectedType + ' /' + filename);
20
+ redirectAndEdit (baseurl + ' #add/' + selectedType + ' /' + filename);
20
21
}
21
22
}
22
23
Original file line number Diff line number Diff line change 152
152
</svg >
153
153
</div >
154
154
<div class =" modal small" on:click |stopPropagation >
155
- <AddContent bind:showAdd bind:showEditor />
155
+ <AddContent bind:showAdd bind:showEditor { env } />
156
156
</div >
157
157
</div >
158
158
Original file line number Diff line number Diff line change 66
66
* @return {boolean} true if hash location found and navigated, false otherwise.
67
67
*/
68
68
const navigateHashLocation = () => {
69
- if (location .pathname != ' /' ) {
69
+ let baseurl = env .baseurl ? env .baseurl : ' /' ;
70
+ if (location .pathname !== baseurl) {
70
71
return false ;
71
72
}
72
73
You can’t perform that action at this time.
0 commit comments