Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: typo #7

Merged
merged 1 commit into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConfigProvider } from 'antd';
import React from 'react';
import { BrowserRouter, HashRouter } from 'react-router-dom';
import RouteConfing from './routes/config';
import RouteConfig from './routes/config';
import zh from 'antd/es/locale/zh_CN';
import en from 'antd/es/locale/en_US';
import { useLanguage } from './utils/useLanguage';
Expand All @@ -24,7 +24,7 @@ export const App = () => {
},
}}
>
<RouteConfing />
<RouteConfig />
</ConfigProvider>
</BrowserRouter>
</React.StrictMode>
Expand Down
4 changes: 2 additions & 2 deletions src/routes/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ const routes: RouteObject[] = [
},
];

const RouteConfing = () => {
const RouteConfig = () => {
const routeContent = useRoutes(routes);

return routeContent;
};

export default RouteConfing;
export default RouteConfig;
12 changes: 6 additions & 6 deletions src/store/socket-message/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class SocketStore extends EventTarget {
case CONNECT:
this.socketConnection = content.selfConnection;
this.filterClient(content);
this.disapatchConnectStatus();
this.dispatchConnectStatus();
break;
case LEAVE:
this.handleNotification(content, 'leave');
Expand All @@ -102,7 +102,7 @@ export class SocketStore extends EventTarget {
if (content.connection.userId === CLIENT_ID) {
this.clientConnection = content.connection;
this.getCacheQueueMessage();
this.disapatchConnectStatus();
this.dispatchConnectStatus();
}
break;
case ERROR:
Expand Down Expand Up @@ -158,22 +158,22 @@ export class SocketStore extends EventTarget {
connectOnline() {
this.connectionStatus = true;
this.pingConnect();
this.disapatchConnectStatus();
this.dispatchConnectStatus();
}

connectOffline() {
this.socket = null;
this.connectionStatus = false;
this.socketConnection = null;
this.clearPing();
this.disapatchConnectStatus();
this.dispatchConnectStatus();
if (!this.reconnectable) {
return;
}
this.tryReconnect();
}

disapatchConnectStatus() {
dispatchConnectStatus() {
this.dispatchEvent(
new CustomEvent('connect-status', {
detail: {
Expand Down Expand Up @@ -309,7 +309,7 @@ export class SocketStore extends EventTarget {
this.connectOffline();
} else if (address === clientAddress) {
this.clientConnection = null;
this.disapatchConnectStatus();
this.dispatchConnectStatus();
setTimeout(() => {
if (!this.clientConnection) {
// the message won't notify if the client reconnect successfully
Expand Down
4 changes: 2 additions & 2 deletions src/utils/withPopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { ComponentType, Dispatch, SetStateAction, ReactNode } from 'react';
export class PopupInstance<I = any, O = any> {
constructor(private update: Dispatch<SetStateAction<PProps<I, O>>>) {}
/**
* Popup the Modal and return a promise object that will be pendding until Modal closed.
* Popup the Modal and return a promise object that will be pending until Modal closed.
* @param {I} params Custom params that will pass to Modal component
* @returns {Promise<>}
*/
Expand Down Expand Up @@ -36,7 +36,7 @@ interface EmptyObject {

/**
* To wrap a Modal component, PProps will be injected into the props,
* wrapped comopnent can use ref as PopupInstance.
* wrapped component can use ref as PopupInstance.
* @param Component A Modal component
* @see PProps
* @see PopupInstance
Expand Down