Skip to content

Commit 3887d9d

Browse files
committed
Fixing border :)
#819 - Refreshing brews when added by visualizer / nfc
1 parent a8bc1e5 commit 3887d9d

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/app/app.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ ion-menu:host .menu-inner {
504504
ion-card {
505505
background-color: #FFFFFF;
506506
border-radius: 6px 6px 6px 6px;
507-
border: 0.5px solid #0000001F;
507+
border: 1px solid rgba(0, 0, 0, 0.05);
508508
/*box-shadow: 0px 0px 10px #0000001F;*/
509509
box-shadow:none;
510510
-webkit-box-shadow: none;

src/app/brew/brew.page.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { Bean } from '../../classes/bean/bean';
1818
import { BrewFilterComponent } from './brew-filter/brew-filter.component';
1919
import { Settings } from '../../classes/settings/settings';
2020
import { AgVirtualSrollComponent } from 'ag-virtual-scroll';
21+
import { Subscription } from 'rxjs';
2122

2223
@Component({
2324
selector: 'brew',
@@ -51,7 +52,7 @@ export class BrewPage implements OnInit {
5152
public archivedBrewsCollapsed: boolean = false;
5253

5354
public settings: Settings;
54-
55+
private brewStorageChangeSubscription: Subscription;
5556
constructor(
5657
private readonly modalCtrl: ModalController,
5758
private readonly uiBrewStorage: UIBrewStorage,
@@ -73,6 +74,13 @@ export class BrewPage implements OnInit {
7374
this.loadBrews();
7475

7576
this.retriggerScroll();
77+
78+
this.brewStorageChangeSubscription = this.uiBrewStorage
79+
.attachOnEvent()
80+
.subscribe((_val) => {
81+
// If an bean is added/deleted/changed we trigger this here, why we do this? Because when we import from the Beanconqueror website an bean, and we're actually on this page, this won't get shown.
82+
this.loadBrews();
83+
});
7684
}
7785

7886
public segmentChanged() {
@@ -387,6 +395,12 @@ export class BrewPage implements OnInit {
387395
}
388396
public ngOnInit() {}
389397

398+
public async ngOnDestroy() {
399+
if (this.brewStorageChangeSubscription) {
400+
this.brewStorageChangeSubscription.unsubscribe();
401+
this.brewStorageChangeSubscription = undefined;
402+
}
403+
}
390404
public async longPressAdd(_event) {
391405
_event.target.blur();
392406
_event.cancelBubble = true;

src/app/dashboard/dashboard.page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export class DashboardPage implements OnInit {
4242
// If an brew is deleted, we need to reset our array for the next call.
4343
this.leftOverBeansWeight = undefined;
4444
this.leftOverFrozenBeansWeight = undefined;
45+
46+
this.loadBrews();
4547
});
4648

4749
this.uiBeanStorage.attachOnEvent().subscribe((_val) => {

0 commit comments

Comments
 (0)