|
|
@@ -73,7 +73,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import {computed, ComputedRef, defineComponent, Ref, ref, useContext, useFetch, useStore, watch} from '@nuxtjs/composition-api'
|
|
|
+import {computed, ComputedRef, defineComponent, onUnmounted, Ref, ref, useContext, useFetch, useStore, watch} from '@nuxtjs/composition-api'
|
|
|
import {NOTIFICATION_TYPE, QUERY_TYPE} from "~/types/enums";
|
|
|
import {Notification} from "~/models/Core/Notification";
|
|
|
import {repositoryHelper} from "~/services/store/repository";
|
|
|
@@ -178,12 +178,16 @@ export default defineComponent({
|
|
|
/**
|
|
|
* Dès l'ouverture du menu, on indique que les notifications non lues, le sont.
|
|
|
*/
|
|
|
- watch(isOpen, (newValue, oldValue) => {
|
|
|
+ const unwatch = watch(isOpen, (newValue, oldValue) => {
|
|
|
if(newValue){
|
|
|
markNotificationsAsRead()
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ onUnmounted(() => {
|
|
|
+ unwatch()
|
|
|
+ })
|
|
|
+
|
|
|
/**
|
|
|
* Marque les notification non lues comme lues
|
|
|
*/
|