Skip to content

Commit

Permalink
fixed other menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam committed Oct 22, 2021
1 parent 17528b5 commit da2200d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
9 changes: 8 additions & 1 deletion src/renderer/views/app/components/AddressBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ const onKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
const { value } = e.currentTarget;
let url = value;

if (isURL(value)) {
if (value.trim() === '') {
callViewMethod(
store.tabs.selectedTabId,
'loadURL',
'https://tab.innatical.com',
);
return;
} else if (isURL(value)) {
url = value.indexOf('://') === -1 ? `http://${value}` : value;
} else {
url = store.settings.searchEngine.url.replace('%s', value);
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/views/app/components/RightButtons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const onDownloadsClick = async (e: React.MouseEvent<HTMLDivElement>) => {

const showMenuDialog = async () => {
const { right, bottom } = menuRef?.getBoundingClientRect() ?? {
right: 0,
bottom: 0,
right: 1000,
bottom: 50,
};
ipcRenderer.send(`show-menu-dialog-${store.windowId}`, right, bottom);
};
Expand Down Expand Up @@ -93,7 +93,7 @@ export const RightButtons = observer(() => {
)}
{store.isIncognito && <ToolbarButton icon={ICON_INCOGNITO} size={18} />}
<ToolbarButton
divRef={(r: any) => (store.addTab.ref = r)}
divRef={(r: any) => (menuRef = r)}
toggled={store.dialogsVisibility['menu']}
badge={store.updateAvailable}
badgeRight={10}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/views/app/models/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class ITab {

public isPlaying = false;

public title = 'New tab';
public title = 'New Tab';

public loading = true;

Expand Down
3 changes: 2 additions & 1 deletion src/renderer/views/app/store/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ export class TabsStore {

const frame = () => {
if (!this.scrollingToEnd) return;
if (!this.containerRef?.current?.scrollWidth) return;
this.containerRef.current.scrollLeft =
this.containerRef.current?.scrollWidth ?? 0;
this.containerRef.current?.scrollWidth || 0;
requestAnimationFrame(frame);
};

Expand Down

0 comments on commit da2200d

Please sign in to comment.