Skip to content

Commit

Permalink
✨ update loading image
Browse files Browse the repository at this point in the history
  • Loading branch information
w3cj committed May 24, 2020
1 parent 8499c75 commit 54c5112
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_STORE
1 change: 1 addition & 0 deletions client/src/assets/entropy-loading.gif
9 changes: 2 additions & 7 deletions client/src/components/Loading.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: rgba(0, 0, 0, 0) none repeat scroll 0% 0%; display: block; shape-rendering: auto;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
<circle cx="50" cy="34" r="12" fill="#b6065a">
<animate attributeName="cy" dur="0.8403361344537814s" repeatCount="indefinite" calcMode="spline" keySplines="0.45 0 0.9 0.55;0 0.45 0.55 0.9" keyTimes="0;0.5;1" values="34;66;34"></animate>
</circle>
<!-- [ldio] generated by https://loading.io/ -->
</svg>
<img src="../assets/entropy-loading.gif" />
</template>

<style>
</style>
</style>
6 changes: 4 additions & 2 deletions client/src/store/modules/auth.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import feathers from '../../feathers';

const loading = () => new Promise((resolve) => setTimeout(resolve, 5000));

export default {
namespaced: true,
state: {
Expand All @@ -12,7 +14,7 @@ export default {
try {
state.loading = true;
const user = await feathers.reAuthenticate();
await new Promise((resolve) => setTimeout(resolve, 3000));
await loading();
state.user = user.user;
} catch (error) {}
state.loading = false;
Expand All @@ -33,7 +35,7 @@ export default {
strategy: 'jwt',
accessToken: event.data.token,
});
await new Promise((resolve) => setTimeout(resolve, 3000));
await loading();
state.user = user.user;
}
state.loading = false;
Expand Down

0 comments on commit 54c5112

Please sign in to comment.