Skip to content

Commit 48e0f35

Browse files
committed
feat(category): add error toast
1 parent b8b0ecc commit 48e0f35

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/components/main/games/category/games-category.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import template from './games-category.html';
55

66
const GamesCategoryComponent = { controller, template };
77

8-
function controller($q, $state, $stateParams, $window, WikiService, langService, wikidata) {
8+
function controller($mdToast, $q, $state, $stateParams, $window, WikiService, langService, wikidata) {
99
const vm = this;
1010
const id = $stateParams.country.includes('Q') ? $stateParams.country : `Q${$stateParams.country}`;
1111

@@ -14,7 +14,7 @@ function controller($q, $state, $stateParams, $window, WikiService, langService,
1414
{ name: 'Germany', code: 'Q183' },
1515
{ name: 'Great Britain', code: 'Q145' },
1616
{ name: 'Poland', code: 'Q36' },
17-
{ name: 'the United States', code: 'Q30' },
17+
{ name: 'the USA', code: 'Q30' },
1818
];
1919
vm.country = id || 'Q36';
2020
vm.loading = true;
@@ -113,6 +113,7 @@ function controller($q, $state, $stateParams, $window, WikiService, langService,
113113
}).catch((err) => {
114114
item.error = err;
115115
item.loading = false;
116+
$mdToast.show($mdToast.simple().textContent(`Error: ${err}`).hideDelay(3000));
116117
});
117118
}
118119
}

src/styles/_general.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
@import 'variables';
22

33
html, body {
4+
height: auto !important;
45
min-width: 100%;
56
min-height: 100%;
67
}
78

89
body {
910
color: $darkGrey;
1011
font: 16px Roboto, Arial, sans-serif;
12+
13+
md-toast.md-bottom {
14+
position: fixed;
15+
}
16+
17+
&.md-toast-animating {
18+
overflow: auto !important;
19+
}
1120
}
1221

1322
::-webkit-scrollbar {

0 commit comments

Comments
 (0)