{bookmark.icon && (
diff --git a/client/src/components/UI/Icons/WeatherIcon/WeatherIcon.tsx b/client/src/components/UI/Icons/WeatherIcon/WeatherIcon.tsx
index 6dcfe56..111967e 100644
--- a/client/src/components/UI/Icons/WeatherIcon/WeatherIcon.tsx
+++ b/client/src/components/UI/Icons/WeatherIcon/WeatherIcon.tsx
@@ -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
}
diff --git a/client/src/components/Widgets/WeatherWidget/WeatherWidget.tsx b/client/src/components/Widgets/WeatherWidget/WeatherWidget.tsx
index 7d7cbd9..b28ef0a 100644
--- a/client/src/components/Widgets/WeatherWidget/WeatherWidget.tsx
+++ b/client/src/components/Widgets/WeatherWidget/WeatherWidget.tsx
@@ -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);
diff --git a/client/src/setupProxy.js b/client/src/setupProxy.js
new file mode 100644
index 0000000..5cafcb1
--- /dev/null
+++ b/client/src/setupProxy.js
@@ -0,0 +1,15 @@
+const { createProxyMiddleware } = require('http-proxy-middleware');
+
+module.exports = function (app) {
+ const apiProxy = createProxyMiddleware('/api', {
+ target: 'http://localhost:5005'
+ })
+
+ const wsProxy = createProxyMiddleware('/socket', {
+ target: 'http://localhost:5005',
+ ws: true
+ })
+
+ app.use(apiProxy);
+ app.use(wsProxy);
+};
\ No newline at end of file
diff --git a/client/src/store/actions/app.ts b/client/src/store/actions/app.ts
index f7eb3a7..1699e31 100644
--- a/client/src/store/actions/app.ts
+++ b/client/src/store/actions/app.ts
@@ -23,10 +23,7 @@ export const getApps = () => async (dispatch: Dispatch) => {
payload: res.data.data
})
} catch (err) {
- dispatch>({
- type: ActionTypes.getAppsError,
- payload: err.data.data
- })
+ console.log(err);
}
}