Skip to content

Commit

Permalink
Use correct temperature unit (#407)
Browse files Browse the repository at this point in the history
* Using correct temperature unit

* Hide can't load files while loading
  • Loading branch information
UnchartedBull authored Feb 7, 2020
1 parent cd5f49e commit df224fc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/bottom-bar/bottom-bar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<td class="bottom-bar__printer-name"> {{ printer.name }} </td>
<td class="bottom-bar__enclosure-temperature" *ngIf="enclosureTemperature">
<img src="assets/thermometer.svg" class="bottom-bar__enclosure-temperature-icon" />
{{ enclosureTemperature.temperature }}°C
{{ enclosureTemperature.temperature }}{{ enclosureTemperature.unit }}
</td>
<td class="bottom-bar__current-status" [ngClass]="{'bottom-bar__error': printer.status.includes('error')}">
{{ printer.status }} </td>
Expand Down
1 change: 1 addition & 0 deletions src/app/bottom-bar/bottom-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ interface Printer {
export interface TemperatureReading {
temperature: number;
humidity: number;
unit: string;
}
3 changes: 2 additions & 1 deletion src/app/files/files.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class FilesComponent {
private router: Router,
private jobService: JobService) {
this.showLoader();
this.folderContent = [];
this.currentFolder = '/';
this.openFolder(this.currentFolder);
}
Expand All @@ -44,7 +45,7 @@ export class FilesComponent {
public openFolder(folderPath: string): void {
setTimeout(() => {
this.showLoader();
this.folderContent = null;
this.folderContent = [];
this.filesService.getFolder(folderPath).then(
(data) => {
this.folderContent = data;
Expand Down
2 changes: 1 addition & 1 deletion src/app/main-menu/main-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Component, OnInit } from '@angular/core';
})
export class MainMenuComponent implements OnInit {

public settings = true;
public settings = false;

public showSettings() {
this.settings = true;
Expand Down
3 changes: 1 addition & 2 deletions src/app/notification/notification.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
border-right: 1vw solid #5a6675;

&__show {
// FIXME
// top: 5vh;
top: 5vh;
}

&__heading {
Expand Down
3 changes: 2 additions & 1 deletion src/app/plugin-service/enclosure.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export class EnclosureService {
(data: EnclosurePluginAPI) => {
observer.next({
temperature: data.temp_sensor_temp,
humidity: data.temp_sensor_humidity
humidity: data.temp_sensor_humidity,
unit: data.use_fahrenheit ? '°F' : '°C'
} as TemperatureReading);
}, (error: HttpErrorResponse) => {
this.notificationService.setError('Can\'t retrieve enclosure temperature!', error.message);
Expand Down

0 comments on commit df224fc

Please sign in to comment.