feat: Add a setting to reload the page (#1132)

* Add reload setting

The iOS PWA version does not allow you to reload the page - even with killing
the app. This is useful for reloading new versions of the app (as well as
solving bad transient state issues).

* make href use #
This commit is contained in:
sgenoud 2019-04-09 04:23:16 +02:00 committed by Nolan Lawson
parent 1dec3b55f9
commit e202dd3444
2 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,4 @@
<a {href} rel="prefetch" aria-label={ariaLabel || label} class="settings-list-button {className ? className : ''}"> <a {href} on:click="fire('click', event)" rel="prefetch" aria-label={ariaLabel || label} class="settings-list-button {className ? className : ''}">
<span> <span>
{label} {label}
</span> </span>

View File

@ -11,6 +11,9 @@
<SettingsListRow> <SettingsListRow>
<SettingsListButton href="/settings/hotkeys" label="Hotkeys"/> <SettingsListButton href="/settings/hotkeys" label="Hotkeys"/>
</SettingsListRow> </SettingsListRow>
<SettingsListRow>
<SettingsListButton href="#" on:click="reload(event)" label="Reload"/>
</SettingsListRow>
<SettingsListRow> <SettingsListRow>
<SettingsListButton href="/settings/about" label="About Pinafore"/> <SettingsListButton href="/settings/about" label="About Pinafore"/>
</SettingsListRow> </SettingsListRow>
@ -29,6 +32,12 @@
SettingsList, SettingsList,
SettingsListRow, SettingsListRow,
SettingsListButton SettingsListButton
},
methods: {
reload (event) {
event.preventDefault()
document.location.reload(true)
}
} }
} }
</script> </script>