Skip to content

Commit

Permalink
fix: about component descritions issues
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Jun 28, 2022
1 parent 1b86fab commit a21e1c1
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ type DescriptionsItem = {
value: string;
};

const isElectron = !!(window && window.process && window.process.type);

const descriptions: DescriptionsItem[] = [
{
id: 'version',
Expand Down Expand Up @@ -54,6 +56,10 @@ const electronDetails: DescriptionsItem[] = [
value: '',
},
];

if (isElectron) {
descriptions.push(...electronDetails);
}
@Component({
selector: 'eo-about',
template: `
Expand Down Expand Up @@ -85,7 +91,6 @@ export class AboutComponent implements OnInit {
constructor(private electron: ElectronService) {}

ngOnInit(): void {
this.appendDetailWithElectron();
// fetch('https://api.github.com/repos/eolinker/eoapi/releases')
// .then((response) => response.json())
// .then((data) => {
Expand Down Expand Up @@ -116,15 +121,6 @@ export class AboutComponent implements OnInit {
});
}

appendDetailWithElectron() {
if (!this.electron.isElectron) {
return;
}

// this.list = [...this.list, ...electronDetails];
this.list.push(...electronDetails);
}

getSystemInfo() {
const systemInfo = this.electron.ipcRenderer.sendSync('get-system-info');
return systemInfo;
Expand Down

0 comments on commit a21e1c1

Please sign in to comment.