Skip to content

Commit 8a9f6b8

Browse files
committed
Remember user choices about hiding alerts. Closes #19
1 parent 8252525 commit 8a9f6b8

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/views/Game.vue

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,23 @@
1313
</b-alert>
1414
<template v-else>
1515
<b-alert
16-
v-if="mostSkippedRulesNotIgnored.length"
16+
v-if="ignoreRuleAlert && mostSkippedRulesNotIgnored.length"
1717
dismissible
18+
@dismissed="ignoreRuleAlert = false"
1819
show
1920
variant="info"
2021
>It looks like you have skipped the same type of suggestions many
2122
times.<br />
2223
If you don't want Wiper to suggest you these kinds of suggestions, you
2324
can ignore them using the top-left menu.</b-alert
2425
>
25-
<b-alert dismissible show variant="light">
26+
<b-alert
27+
v-if="introAlert"
28+
dismissible
29+
@dismissed="introAlert = false"
30+
show
31+
variant="light"
32+
>
2633
Wiper found Wikipedia articles with potential spelling or grammar
2734
issues.<br />
2835
Click on <decision-button decision="fix" read-only /> to fix the issue
@@ -43,14 +50,15 @@
4350

4451
<script>
4552
import TileList from "@/components/TileList.vue";
46-
import axios from "axios";
47-
import { mapActions, mapGetters, mapState } from "vuex";
53+
import { mapGetters, mapState } from "vuex";
4854
import DecisionButton from "../components/DecisionButton";
4955
5056
export default {
5157
name: "game",
5258
data: () => ({
5359
error: null,
60+
introAlert: true,
61+
ignoreRuleAlert: true,
5462
}),
5563
5664
computed: {
@@ -72,6 +80,10 @@ export default {
7280
},
7381
7482
methods: {
83+
test() {
84+
console.log("!");
85+
this.ignoreRuleAlert = false;
86+
},
7587
async applyDecision({ decision, reason = null }) {
7688
const vm = this;
7789
await this.$store
@@ -94,8 +106,6 @@ export default {
94106
},
95107
},
96108
97-
...mapActions("tiles", ["apply-decision", "nextTile"]),
98-
99109
components: {
100110
DecisionButton,
101111
TileList,

0 commit comments

Comments
 (0)