Skip to content

Commit

Permalink
print a message on /, when no block is finded
Browse files Browse the repository at this point in the history
  • Loading branch information
aitorjs committed Jun 10, 2020
1 parent fd6ad62 commit a7d6c47
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
5 changes: 5 additions & 0 deletions front/bitcoind-zmq/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions front/bitcoind-zmq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@smartweb/vue-flash-message": "^0.6.4",
"apollo-cache-inmemory": "^1.6.5",
"apollo-client": "^2.6.8",
"apollo-link-http": "^1.5.16",
Expand Down
17 changes: 16 additions & 1 deletion front/bitcoind-zmq/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
</v-flex>
</v-layout>
</v-navigation-drawer>

<v-content style="margin: 0 50px 0 50px;">
<FlashMessage></FlashMessage>
<router-view />
</v-content>
</v-app>
Expand All @@ -46,3 +46,18 @@ export default {
}
};
</script>
<style>
._vue-flash-msg-body__icon {
background-color: #f56969 !important;
}
._vue-flash-msg-body__icon img {
width: 40% !important;
}
._vue-flash-msg-body._vue-flash-msg-body_error ._vue-flash-msg-body__content {
border-left: none !important;
}
._vue-flash-msg-body {
z-index: 9;
border-radius: 0;
}
</style>
4 changes: 4 additions & 0 deletions front/bitcoind-zmq/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import ApolloClient from 'apollo-client'
import { WebSocketLink } from 'apollo-link-ws'
import { InMemoryCache } from 'apollo-cache-inmemory'
import vuetify from './plugins/vuetify';
import FlashMessage from '@smartweb/vue-flash-message';

Vue.use(VueApollo)
Vue.use(FlashMessage, {time: 3000});

Vue.config.productionTip = false

Expand Down Expand Up @@ -39,6 +41,8 @@ const client = new ApolloClient({
})
})

// Vue.prototype.$errors = [];

const apolloProvider = new VueApollo({
defaultClient: client
})
Expand Down
20 changes: 15 additions & 5 deletions front/bitcoind-zmq/src/views/Block-details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,22 @@ export default {
},
update: data => data.getblock,
result({ data }) {
if (data.getblock === undefined) {
this.$router.push("/");
}
/* if (data.getblock === undefined) {
// this.flashMessage.setStrategy("single");
} */
console.log("data from graphql", data);
},
error(error) {
this.error = JSON.stringify(error.message);
error() {
/* console.log("ERROR making query", error.message);
this.errors = JSON.stringify(error.message); */
this.flashMessage.error({
// status: "error",
title: "Block not found",
message: "Not yet in this bitcoin node",
position: "bottom right",
icon: "/error.svg"
});
this.$router.push("/");
}
}
},
Expand Down

0 comments on commit a7d6c47

Please sign in to comment.