fix: rename auto-reload to live-reload

This commit is contained in:
Pruthvi Patel 2021-10-18 17:52:33 +05:30
parent 01d69b67c7
commit d99403393a
3 changed files with 12 additions and 8 deletions

View file

@ -44,7 +44,7 @@ let argv = yargs
type: "boolean",
description: "Run in watch mode and rebuild on file changes"
})
.option("auto-reload", {
.option("live-reload", {
type: "boolean",
description: `Automatically reload webpages when assets are rebuilt.
Can only be used with the --watch flag.`
@ -481,7 +481,7 @@ async function notify_redis({ error, success }) {
if (success) {
payload = {
success: true,
autoreload: argv["auto-reload"]
live_reload: argv["live-reload"]
};
}

View file

@ -235,8 +235,12 @@ def watch(apps=None):
if apps:
command += " --apps {apps}".format(apps=apps)
if frappe.conf.autoreload_on_build:
command += " --auto-reload"
live_reload = frappe.conf.live_reload
if "LIVE_RELOAD" in os.environ:
live_reload = os.environ["LIVE_RELOAD"]
if live_reload:
command += " --live-reload"
check_node_executable()
frappe_app_path = frappe.get_app_path("frappe", "..")

View file

@ -5,7 +5,7 @@
>
Compiled successfully
<a
v-if="!autoreload"
v-if="!live_reload"
class="ml-4 text-white underline" href="/" @click.prevent="reload"
>
Refresh
@ -18,13 +18,13 @@ export default {
data() {
return {
is_shown: false,
autoreload: false,
live_reload: false,
};
},
methods: {
show(data) {
if (data.autoreload) {
this.autoreload = true;
if (data.live_reload) {
this.live_reload = true;
this.reload();
}