Skip to content

Commit f1c13cc

Browse files
author
root
committed
fix(wrapped): await parser messages and fix year-review CTA link
1 parent 857e8c9 commit f1c13cc

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

pages/whatsapp-wrapped-year-review.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<p>
88
<strong>{{ $t("wrapped.analyzeSafely") }}</strong>
99
</p>
10-
<button class="cta-button" @click="goToHome">
10+
<NuxtLink :to="localePath('/wrapped')" class="cta-button">
1111
{{ $t("wrapped.ctaButton") }}
12-
</button>
12+
</NuxtLink>
1313
</div>
1414
</header>
1515

@@ -89,11 +89,7 @@ export default {
8989
currentYear: new Date().getFullYear(), // Dynamically set the current year
9090
};
9191
},
92-
methods: {
93-
goToHome() {
94-
this.$router.push(this.localePath("/wrapped"));
95-
},
96-
},
92+
methods: {},
9793
};
9894
</script>
9995

@@ -122,6 +118,7 @@ export default {
122118
}
123119
124120
.cta-button {
121+
display: inline-block;
125122
background: #fff;
126123
color: #128c7e;
127124
border: none;
@@ -130,6 +127,7 @@ export default {
130127
cursor: pointer;
131128
margin-top: 20px;
132129
border-radius: 5px;
130+
text-decoration: none;
133131
}
134132
135133
.cta-button:hover {

utils/wrapped/parsing/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ class Parser {
4747

4848
async run(file: File): Promise<ParserResult> {
4949
const textData = await this.readFile(file);
50-
const messages = whatsapp.parseString(textData, {
50+
const messages = await whatsapp.parseString(textData, {
5151
parseAttachments: true,
5252
});
5353
const validMessages = this.filterValidMessages(messages);
54-
5554
return {
5655
getMostUsedEmojis: getMostUsedEmojis(validMessages),
5756
getNumberOfMessagesPerMonth: getNumberOfMessagesPerMonth(validMessages),

0 commit comments

Comments
 (0)