Browse Source

Dynamic unsubscribing

main
Nicolai Ort 3 months ago
parent
commit
ada12fd4db
Signed by: niggl GPG Key ID: 13AFA55AF62F269F
  1. 1
      src/routes/details.svelte
  2. 3
      src/routes/visits.svelte

1
src/routes/details.svelte

@ -20,6 +20,7 @@
if (value.isLoggedIn) {
Apiclient.getUrlDetails(shortcode).then((res) => {
urlDetails = res;
unsubscribe();
});
visitQuery = Apiclient.getUrlVisits(shortcode).then((res) => {
urlVisists = res;

3
src/routes/visits.svelte

@ -11,11 +11,10 @@
if (value.isLoggedIn) {
visitQuery = Apiclient.getVisits().then((res) => {
visits = res;
unsubscribe();
});
}
});
onDestroy(unsubscribe);
</script>
<h2 class="text-3xl font-bold text-gray-800 dark:text-gray-100 pb-6">View all visits</h2>

Loading…
Cancel
Save