Skip to content

Commit

Permalink
fix: update props types for rhs_sidebar.tsx
Browse files Browse the repository at this point in the history
- update props types as optional according to original jsx component
  • Loading branch information
hereje committed Oct 24, 2024
1 parent 11cff2c commit cb352e2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions webapp/src/components/rhs_sidebar/rhs_sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const UserHeader = (props: UserHeaderProps) => (

interface UserHeaderProps {
currentUserId: string;
username: string;
gitlabURL: string;
username?: string;
gitlabURL?: string;
}

const Subscription = (props: SubscriptionProps) => {
Expand Down Expand Up @@ -125,7 +125,7 @@ const Subscriptions = (props: SubscriptionsProps) => {
};

interface SubscriptionsProps {
currentChannelId: string;
currentChannelId?: string;
subscriptions: Subscription[];
}

Expand All @@ -138,13 +138,13 @@ interface Subscription {
interface RhsSidebarProps {
currentUserId: string,
connected: boolean,
username: string,
gitlabURL: string,
currentChannelId: string,
currentChannelSubscriptions: Subscription[],
username?: string,
gitlabURL?: string,
currentChannelId?: string,
currentChannelSubscriptions: Partial<Subscription>[],
pluginServerRoute: string,
actions: {
getChannelSubscriptions: (channel: string) => Promise<void>,
getChannelSubscriptions: (channel: string) => Promise<any>,
sendEphemeralPost: (message: string) => void;
}
}
Expand Down Expand Up @@ -184,7 +184,7 @@ export default class RHSSidebar extends React.PureComponent<RhsSidebarProps, Rhs
}

this.setState({refreshing: true});
await this.props.actions.getChannelSubscriptions(this.props.currentChannelId);
await this.props.actions.getChannelSubscriptions(this.props.currentChannelId as string);
this.setState({refreshing: false});
}

Expand All @@ -207,7 +207,7 @@ export default class RHSSidebar extends React.PureComponent<RhsSidebarProps, Rhs
/>
<Subscriptions
currentChannelId={this.props.currentChannelId}
subscriptions={this.props.currentChannelSubscriptions}
subscriptions={this.props.currentChannelSubscriptions as Subscription[]}
/>
</div>
);
Expand Down

0 comments on commit cb352e2

Please sign in to comment.