From 626ff1d82538e2a3e128e9a5b4e9dcb385ff3296 Mon Sep 17 00:00:00 2001 From: Alice Zhao Date: Mon, 9 Sep 2024 16:18:37 -0700 Subject: [PATCH] doc: transformURL --- docs/fiddles/features/navigation-history/renderer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/fiddles/features/navigation-history/renderer.js b/docs/fiddles/features/navigation-history/renderer.js index 060e4a6569..741cc80933 100644 --- a/docs/fiddles/features/navigation-history/renderer.js +++ b/docs/fiddles/features/navigation-history/renderer.js @@ -20,7 +20,7 @@ async function updateURL () { urlInput.value = await window.electronAPI.getCurrentURL() } -function transformUrl (url) { +function transformURL (url) { if (!url.startsWith('http://') && !url.startsWith('https://')) { const updatedUrl = 'https://' + url return updatedUrl @@ -29,14 +29,14 @@ function transformUrl (url) { } async function navigate (url) { - const urlInput = transformUrl(url) + const urlInput = transformURL(url) await window.electronAPI.loadURL(urlInput) } async function showHistory (forward = false) { const history = await window.electronAPI.getHistory() - const currentIndex = history.findIndex(entry => entry.url === transformUrl(urlInput.value)) + const currentIndex = history.findIndex(entry => entry.url === transformURL(urlInput.value)) if (!currentIndex) { return