Skip to content

Commit 456fbc4

Browse files
committed
v1.5.1 bug fixes. Fixed #18, #19
1 parent f452e25 commit 456fbc4

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ All notable changes to this project will be documented in this file.
1212

1313
# v1.x (official releases)
1414

15+
### [1.5.1](https://github.com/lxieyang/vertical-tabs-chrome-extension/releases/tag/v1.5.1) (2019-12-29)
16+
17+
- Fixed a bug where the `new URL()` API returns invalid.
18+
- Removed redundant code on search bar auto focus.
19+
1520
### [1.5.0](https://github.com/lxieyang/vertical-tabs-chrome-extension/releases/tag/v1.5.0) (2019-12-26)
1621

1722
- Dark theme support! 🕶️🕶️🕶️

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vertical-tabs-chrome-extension",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
44
"description": "A chrome extension that presents your tabs vertically.",
55
"license": "MIT",
66
"repository": {

src/pages/Sidebar/Sidebar.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Sidebar extends Component {
102102
status: 'complete',
103103
combinedText: [
104104
tab.title, // title
105-
new URL(tab.url).hostname.replace('www.', ''), // hostname
105+
tab.url !== '' ? new URL(tab.url).hostname.replace('www.', '') : '', // hostname
106106
]
107107
.join(' ')
108108
.toLowerCase(),
@@ -156,7 +156,7 @@ class Sidebar extends Component {
156156
status: tab.status,
157157
combinedText: [
158158
tab.title, // title
159-
new URL(tab.url).hostname.replace('www.', ''), // hostname
159+
tab.url !== '' ? new URL(tab.url).hostname.replace('www.', '') : '', // hostname
160160
]
161161
.join(' ')
162162
.toLowerCase(),

src/pages/Sidebar/containers/TabsList/SearchBar/SearchBar.jsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useRef, useContext } from 'react';
1+
import React, { useContext } from 'react';
22
import DarkModeContext from '../../../context/dark-mode-context';
33
import './SearchBar.css';
44

@@ -10,27 +10,10 @@ const SearchBar = ({
1010
const darkModeContext = useContext(DarkModeContext);
1111
const { isDark } = darkModeContext;
1212

13-
useEffect(() => {
14-
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
15-
if (request.from === 'background' && request.msg === 'TOGGLE_SIDEBAR') {
16-
if (request.toStatus) {
17-
this.searchInput.focus();
18-
} else {
19-
this.searchInput.blur();
20-
}
21-
}
22-
});
23-
}, []);
24-
25-
let inputRef = useRef(null);
26-
2713
return (
2814
<div className="SearchBarContainer">
2915
<input
3016
// autoFocus
31-
ref={(input) => {
32-
inputRef = input;
33-
}}
3417
type="search"
3518
className={['SearchBarInput', isDark ? 'Dark' : null].join(' ')}
3619
placeholder={'🔍 search tabs here'}

0 commit comments

Comments
 (0)