Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PWA notice on light mode #1391

Merged
merged 1 commit into from
Jul 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions src/cockpit/components/CPWA.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<template>
<n-alert
v-if="needRefresh"
class="pwa-toast"
title="Update"
type="info"
closable
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might make more sense to force update so, making this unclosable.

>
New content available, click on reload button to update.
<n-alert v-if="needRefresh" class="pwa-toast" title="Update" type="info">
New version available. Click here to update.
<br />
<n-button @click="updateServiceWorker()"> Reload </n-button>
<n-button @click="updateServiceWorker()">Update</n-button>
</n-alert>
</template>

Expand All @@ -20,14 +14,17 @@ const { needRefresh, updateServiceWorker } = useRegisterSW();
</script>

<style>
#app .dark_mode .pwa-toast {
background-color: #15344a;
}
Comment on lines +17 to +19
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Light mode background already not opaque anyway. 🤷‍♂️ So changing this for dark mode only.


#app .pwa-toast {
position: fixed;
right: 0;
bottom: 0;
margin: 10px;
z-index: 1;
text-align: left;
background-color: #15344a;
}

.pwa-toast .n-alert-body {
Expand Down