Skip to content

Commit

Permalink
issues/3
Browse files Browse the repository at this point in the history
  • Loading branch information
koluch committed Jan 9, 2019
1 parent 681edfe commit 65cf22c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 2 additions & 0 deletions app/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export default class extends Component<IProps, IState> {
updateTabs() {
Browser.getCurrentSession().then((session) => {
this.setState({ session })
}).catch((e) => {
console.error(`Unable to get current session`, e);
})
}

Expand Down
5 changes: 3 additions & 2 deletions app/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { h, Component } from 'preact';
import {ISavedSession, ISavedSessionHeader, ITab, IWindow} from "../../types";
import {Component, h} from 'preact';
import {ISavedSessionHeader, IWindow} from "../../types";
import cn from 'classnames';
import plural from "../../helpers/plural";

const styles = require('./index.less');

export type UITab = 'CURRENT' | 'SAVED';
Expand Down
2 changes: 1 addition & 1 deletion app/components/Tab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class extends Component<IProps> {
href={tab.url}
title={tab.url}
>
{tab.title}
{tab.title || '<no title>'}
</a>
{onClose && <CloseIcon onClick={onClose} />}
</div>
Expand Down
7 changes: 2 additions & 5 deletions app/services/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,17 +347,14 @@ const ProductionBrowser: IBrowser = {
}

if (window.tabs !== null && window.tabs !== undefined) {
tabs = window.tabs.map(({id, windowId, active, url, title, favIconUrl, pinned}): ITab => {
tabs = window.tabs.map(({ id, windowId, active, url, title, favIconUrl, pinned }): ITab => {
if (id === null || id === undefined) {
throw new Error(`This extension doesn't support tabs with null id's. This should actually never happen`)
}
if (url === null || url === undefined) {
throw new Error(`URL should not be null, since we require 'tabs' permission`)
}
if (title === null || title === undefined) {
throw new Error(`URL should not be null, since we require 'tabs' permission`)
}
return {id, windowId, active, url, title, favIconUrl: favIconUrl || null, pinned};
return {id, windowId, active, url, title: title || null, favIconUrl: favIconUrl || null, pinned};
});
} else {
console.error(`windows.tabs should never be null, since we use "populate: true" option`);
Expand Down
2 changes: 1 addition & 1 deletion app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface INewTab {
// microphone: boolean
// },
url: string,
title: string,
title: string | null,
favIconUrl: string | null,
}

Expand Down

0 comments on commit 65cf22c

Please sign in to comment.