mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-06 20:43:13 +08:00
Fixed bug with overwriting opened tabs. Added proxy for websocket
This commit is contained in:
@@ -17,7 +17,7 @@ const AppCard = (props: ComponentProps): JSX.Element => {
|
||||
}
|
||||
|
||||
return (
|
||||
<a href={`http://${props.app.url}`} target='blank' className={classes.AppCard}>
|
||||
<a href={`http://${props.app.url}`} target='_blank' className={classes.AppCard}>
|
||||
<div className={classes.AppCardIcon}>
|
||||
<Icon icon={iconParser(props.app.icon)} />
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ const BookmarkCard = (props: ComponentProps): JSX.Element => {
|
||||
{props.category.bookmarks.map((bookmark: Bookmark) => (
|
||||
<a
|
||||
href={`http://${bookmark.url}`}
|
||||
target='blank'
|
||||
target='_blank'
|
||||
key={`bookmark-${bookmark.id}`}>
|
||||
{bookmark.icon && (
|
||||
<div className={classes.BookmarkIcon}>
|
||||
|
||||
@@ -12,8 +12,8 @@ interface ComponentProps {
|
||||
|
||||
const WeatherIcon = (props: ComponentProps): JSX.Element => {
|
||||
const icon = props.isDay
|
||||
? (new IconMapping).mapIcon(props.weatherStatusCode, TimeOfDay.day)
|
||||
: (new IconMapping).mapIcon(props.weatherStatusCode, TimeOfDay.night);
|
||||
? new IconMapping().mapIcon(props.weatherStatusCode, TimeOfDay.day)
|
||||
: new IconMapping().mapIcon(props.weatherStatusCode, TimeOfDay.night);
|
||||
|
||||
useEffect(() => {
|
||||
const delay = setTimeout(() => {
|
||||
@@ -25,7 +25,7 @@ const WeatherIcon = (props: ComponentProps): JSX.Element => {
|
||||
return () => {
|
||||
clearTimeout(delay);
|
||||
}
|
||||
}, [props.weatherStatusCode]);
|
||||
}, [props.weatherStatusCode, icon, props.theme.colors.accent]);
|
||||
|
||||
return <canvas id={`weather-icon`} width='50' height='50'></canvas>
|
||||
}
|
||||
|
||||
@@ -50,7 +50,11 @@ const WeatherWidget = (): JSX.Element => {
|
||||
|
||||
// Open socket for data updates
|
||||
useEffect(() => {
|
||||
const webSocketClient = new WebSocket('ws://localhost:5005');
|
||||
const webSocketClient = new WebSocket(`ws://${window.location.host}/socket`);
|
||||
|
||||
webSocketClient.onopen = () => {
|
||||
console.log('Socket: listen')
|
||||
}
|
||||
|
||||
webSocketClient.onmessage = (e) => {
|
||||
const data = JSON.parse(e.data);
|
||||
|
||||
Reference in New Issue
Block a user