Skip to content

Commit 2df5347

Browse files
committed
fix: simplify getting the hostname
1 parent c0ae208 commit 2df5347

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/popup/addEditInterface.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ function AddEditInterface(settingsModel) {
294294
)[0];
295295
const host = new URL(currentTab.url).host;
296296
// prefill the host of the current tab
297-
loginObj.login = host;
297+
if (settings.origin !== "null") {
298+
const hostname = new URL(settings.origin).hostname;
299+
loginObj.login = hostname;
300+
}
298301
}
299302

300303
// set the storePath and get tree dirs

0 commit comments

Comments
 (0)