Skip to content

Commit

Permalink
Updated example widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
azizsafudin committed Jul 4, 2018
1 parent f738a7d commit 3a61973
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/components/widgets/example.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- Javascript goes here-->
<!--https://vuejs.org/v2/guide/components.html-->
<script>
import storage from '../../helpers/storage'; // use this to access localStorage
import store from '../../store';

const widget_name = 'example'; // make it same as file name for ease
const manifest = {
Expand Down Expand Up @@ -43,8 +43,7 @@ const manifest = {
export default {
name: manifest.name,
data: () => ({
// settings: storage.getSettings(manifest.name),
dark: storage.getSettings('mdash').dark.value,
dark: store.getters.settings.mdash.dark.value,
}),
manifest: manifest, // REQUIRED
computed: {
Expand Down
3 changes: 2 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ new Vue({
longitude: pos.coords.longitude,
};

if(saved_pos === null || saved_pos !== null && (saved_pos.latitude !== pos.coords.latitude || saved_pos.longitude !== pos.coords.longitude)){
if(saved_pos === null || saved_pos !== null &&
(saved_pos.latitude !== pos.coords.latitude || saved_pos.longitude !== pos.coords.longitude || !saved_pos.city_long)){
axios.get(url)
.then(res => {
let locality = res.data.results[0].address_components.filter(function(o){
Expand Down

0 comments on commit 3a61973

Please sign in to comment.