diff --git a/website/client/app.vue b/website/client/app.vue index 55400adec6..d8d36bddc0 100644 --- a/website/client/app.vue +++ b/website/client/app.vue @@ -14,10 +14,17 @@ div router-view(v-if="!isUserLoggedIn || isStaticPage") template(v-else) template(v-if="isUserLoaded") + div.resting-banner(v-if="showRestingBanner") + span.content + span.label {{ $t('innCheckOutBanner') }} + span.separator | + span.resume(@click="resumeDamage()") {{ $t('resumeDamage') }} + div.closepadding(@click="hideBanner()") + span.svg-icon.inline.icon-10(aria-hidden="true", v-html="icons.close") notifications-display - app-menu + app-menu(:class='{"restingInn": showRestingBanner}') .container-fluid - app-header + app-header(:class='{"restingInn": showRestingBanner}') buyModal( :item="selectedItemToBuy || {}", :withPin="true", @@ -34,13 +41,15 @@ div div(:class='{sticky: user.preferences.stickyHeader}') router-view - app-footer + app-footer audio#sound(autoplay, ref="sound") source#oggSource(type="audio/ogg", :src="sound.oggSource") source#mp3Source(type="audio/mp3", :src="sound.mp3Source") - diff --git a/website/client/components/groups/tavern.vue b/website/client/components/groups/tavern.vue index efdb65ef4a..919cfa9703 100644 --- a/website/client/components/groups/tavern.vue +++ b/website/client/components/groups/tavern.vue @@ -720,7 +720,6 @@ export default { this.newMessage = newText; }, toggleSleep () { - this.user.preferences.sleep = !this.user.preferences.sleep; this.$store.dispatch('user:sleep'); }, async sendMessage () { diff --git a/website/client/store/actions/user.js b/website/client/store/actions/user.js index ecbd5683a5..809407a63e 100644 --- a/website/client/store/actions/user.js +++ b/website/client/store/actions/user.js @@ -56,7 +56,11 @@ export async function set (store, changes) { // .catch((err) => console.error('set', err)); } -export async function sleep () { +export async function sleep (store) { + const user = store.state.user.data; + + user.preferences.sleep = !user.preferences.sleep; + let response = await axios.post('/api/v3/user/sleep'); return response.data.data; } diff --git a/website/common/locales/en/groups.json b/website/common/locales/en/groups.json index 8fd63fe398..74a3d422b2 100644 --- a/website/common/locales/en/groups.json +++ b/website/common/locales/en/groups.json @@ -5,6 +5,8 @@ "innCheckIn": "Rest in the Inn", "innText": "You're resting in the Inn! While checked-in, your Dailies won't hurt you at the day's end, but they will still refresh every day. Be warned: If you are participating in a Boss Quest, the Boss will still damage you for your Party mates' missed Dailies unless they are also in the Inn! Also, your own damage to the Boss (or items collected) will not be applied until you check out of the Inn.", "innTextBroken": "You're resting in the Inn, I guess... While checked-in, your Dailies won't hurt you at the day's end, but they will still refresh every day... If you are participating in a Boss Quest, the Boss will still damage you for your Party mates' missed Dailies... unless they are also in the Inn... Also, your own damage to the Boss (or items collected) will not be applied until you check out of the Inn... so tired...", + "innCheckOutBanner": "You are currently checked into the Inn. Your Dailies won't damage you and you won't make progress towards Quests.", + "resumeDamage": "Resume Damage", "helpfulLinks": "Helpful Links", "communityGuidelinesLink": "Community Guidelines", "lookingForGroup": "Looking for Group (Party Wanted) Posts",