Browse Source

eqeqeq fix

Leszek Wiesner 4 years ago
parent
commit
c6549d8ece

+ 1 - 1
pioneer/packages/joy-media/src/channels/ChannelHelpers.ts

@@ -26,7 +26,7 @@ export function isPublicChannel (channel: ChannelType): boolean {
 }
 
 export function isCensoredChannel (channel: ChannelType): boolean {
-  return channel.curationStatus == 'Censored';
+  return channel.curationStatus === 'Censored';
 }
 
 export function isVerifiedChannel (channel: ChannelType): boolean {

+ 1 - 1
pioneer/packages/joy-media/src/channels/CurationPanel.tsx

@@ -23,7 +23,7 @@ export const CurationPanel = (props: ChannelCurationPanelProps) => {
       return account.eq(allAccounts[key].json.address);
     });
 
-    return ix != -1;
+    return ix !== -1;
   };
 
   const renderToggleCensorshipButton = () => {

+ 1 - 1
pioneer/packages/joy-roles/src/StakeRequirement.tsx

@@ -31,7 +31,7 @@ export abstract class StakeRequirement {
   }
 
   qualifier (): string | null {
-    if (this.type == StakeType.AtLeast) {
+    if (this.type === StakeType.AtLeast) {
       return 'at least';
     }
     return null;

+ 2 - 2
pioneer/packages/joy-roles/src/classifiers.ts

@@ -277,10 +277,10 @@ export function classifyApplicationCancellation (a: Application): CancelledReaso
 export function isApplicationHired (a: Application): boolean {
   switch (a.stage.type) {
     case ApplicationStageKeys.Unstaking:
-      return (a.stage.value as UnstakingApplicationStage).cause.type == ApplicationDeactivationCauseKeys.Hired;
+      return (a.stage.value as UnstakingApplicationStage).cause.type === ApplicationDeactivationCauseKeys.Hired;
 
     case ApplicationStageKeys.Inactive:
-      return (a.stage.value as InactiveApplicationStage).cause.type == ApplicationDeactivationCauseKeys.Hired;
+      return (a.stage.value as InactiveApplicationStage).cause.type === ApplicationDeactivationCauseKeys.Hired;
   }
 
   return false;

+ 3 - 3
pioneer/packages/joy-roles/src/elements.tsx

@@ -62,7 +62,7 @@ type MemberProps = ActorProps & BalanceProps & ProfileProps
 
 export function MemberView (props: MemberProps) {
   let avatar = <Identicon value={props.actor.account.toString()} size={50} />;
-  if (typeof props.profile.avatar_uri !== 'undefined' && props.profile.avatar_uri.toString() != '') {
+  if (typeof props.profile.avatar_uri !== 'undefined' && props.profile.avatar_uri.toString() !== '') {
     avatar = <Image src={props.profile.avatar_uri.toString()} circular className='avatar' />;
   }
 
@@ -116,7 +116,7 @@ export function GroupLeadView (props: GroupLead & inset) {
   }
 
   let avatar = <Identicon value={props.roleAccount.toString()} size={50} />;
-  if (typeof props.profile.avatar_uri !== 'undefined' && props.profile.avatar_uri.toString() != '') {
+  if (typeof props.profile.avatar_uri !== 'undefined' && props.profile.avatar_uri.toString() !== '') {
     avatar = <Image src={props.profile.avatar_uri.toString()} circular className='avatar' />;
   }
 
@@ -161,7 +161,7 @@ export function GroupMemberView (props: GroupMember & inset) {
   }
 
   let avatar = <Identicon value={props.roleAccount.toString()} size={50} />;
-  if (typeof props.profile.avatar_uri !== 'undefined' && props.profile.avatar_uri.toString() != '') {
+  if (typeof props.profile.avatar_uri !== 'undefined' && props.profile.avatar_uri.toString() !== '') {
     avatar = <Image src={props.profile.avatar_uri.toString()} circular className='avatar' />;
   }
 

+ 1 - 1
pioneer/packages/joy-roles/src/flows/apply.controller.tsx

@@ -79,7 +79,7 @@ export class ApplyController extends Controller<State, ITransport> {
     }
     const id = parseInt(rawId);
 
-    if (this.currentOpeningId == id) {
+    if (this.currentOpeningId === id) {
       return;
     }
 

+ 2 - 2
pioneer/packages/joy-roles/src/flows/apply.tsx

@@ -367,7 +367,7 @@ function stakeCount (props: StakeRequirementProps): number {
 
 function zeroOrTwoStakes (props: StakeRequirementProps): boolean {
   const count = stakeCount(props);
-  return (count == 0 || count == 2);
+  return (count === 0 || count === 2);
 }
 
 function bothStakesVariable (props: StakeRequirementProps): boolean {
@@ -498,7 +498,7 @@ export function ConfirmStakes2Up (props: ConfirmStakes2UpProps) {
   const [combined, setCombined] = useState(new u128(0));
 
   const findRankValue = (newStake: Balance): number => {
-    if (slotCount == 0) {
+    if (slotCount === 0) {
       return 0;
     }
 

+ 4 - 4
pioneer/packages/joy-roles/src/tabs/Admin.controller.tsx

@@ -570,7 +570,7 @@ export class AdminController extends Controller<State, ITransport> {
 
   async applyAsACurator (creatorAddress: string, openingId: number) {
     const membershipIds = (await this.api.query.members.memberIdsByControllerAccountId(creatorAddress)) as Vec<MemberId>;
-    if (membershipIds.length == 0) {
+    if (membershipIds.length === 0) {
       console.error('No membship ID associated with this address');
       return;
     }
@@ -867,7 +867,7 @@ const NewOpening = (props: NewOpeningProps) => {
       StakingPolicy,
       new StakingPolicy({
         amount: new u128(stakeValue),
-        amount_mode: mode == '' && policy[fieldName].isSome ? policy[fieldName].type : mode
+        amount_mode: mode === '' && policy[fieldName].isSome ? policy[fieldName].type : mode
       })
     );
     onChangePolicyField(fieldName, value);
@@ -903,7 +903,7 @@ const NewOpening = (props: NewOpeningProps) => {
           options={openingAtOptions}
           value={start.type}
         />
-        {showExactBlock == true &&
+        {showExactBlock === true &&
           <Input
             type="number"
             value={exactBlock}
@@ -990,7 +990,7 @@ const OpeningView = (props: OpeningViewProps) => {
 
   const toggleApplication = (id: number) => {
     if (selected.includes(id)) {
-      setSelected(selected.filter(v => v != id));
+      setSelected(selected.filter(v => v !== id));
     } else {
       setSelected([...selected, id]);
     }

+ 4 - 4
pioneer/packages/joy-roles/src/tabs/MyRoles.tsx

@@ -153,7 +153,7 @@ export const CurrentRoles = Loadable<CurrentRolesProps>(
             </Table.Body>
           </Table>
         }
-        {props.currentRoles.length == 0 &&
+        {props.currentRoles.length === 0 &&
           <p>You are not currently in any working group roles.</p>
         }
       </Container>
@@ -381,7 +381,7 @@ function CancelButton (props: ApplicationProps) {
 
 export function Application (props: ApplicationProps) {
   let countdown = null;
-  if (props.stage.state == OpeningState.InReview) {
+  if (props.stage.state === OpeningState.InReview) {
     countdown = <OpeningBodyReviewInProgress {...props.stage} />;
   }
 
@@ -389,7 +389,7 @@ export function Application (props: ApplicationProps) {
   const appState = applicationState(props);
 
   let CTA = null;
-  if (appState == ApplicationState.Positive && props.stage.state != OpeningState.Complete) {
+  if (appState === ApplicationState.Positive && props.stage.state !== OpeningState.Complete) {
     CTA = <CancelButton {...props} />;
   }
 
@@ -483,7 +483,7 @@ export const Applications = Loadable<ApplicationsProps>(
       {props.applications.map((app, key) => (
         <Application key={key} cancelCallback={props.cancelCallback} {...app} />
       ))}
-      {props.applications.length == 0 &&
+      {props.applications.length === 0 &&
         <p>You have no active applications.</p>
       }
     </Container>

+ 1 - 1
pioneer/packages/joy-roles/src/tabs/Opportunities.tsx

@@ -215,7 +215,7 @@ export function ApplicationCount (props: ApplicationCountProps) {
 type OpeningBodyCTAProps = OpeningStakeAndApplicationStatus & OpeningStage & OpeningBodyProps & MemberIdProps
 
 function OpeningBodyCTAView (props: OpeningBodyCTAProps) {
-  if (props.stage.state != OpeningState.AcceptingApplications || applicationImpossible(props.applications)) {
+  if (props.stage.state !== OpeningState.AcceptingApplications || applicationImpossible(props.applications)) {
     return null;
   }
 

+ 1 - 1
pioneer/packages/joy-roles/src/transport.substrate.ts

@@ -589,7 +589,7 @@ export class Transport extends TransportBase implements ITransport {
       const membershipIds = (
         await this.cachedApi.query.members.memberIdsByControllerAccountId(sourceAccount)
       ) as Vec<MemberId>;
-      if (membershipIds.length == 0) {
+      if (membershipIds.length === 0) {
         reject('No membship ID associated with this address');
       }
 

+ 1 - 1
pioneer/packages/joy-settings/src/Settings.ts

@@ -40,7 +40,7 @@ export class Settings implements SettingsStruct {
 
     // Transition from acropolis - since visitors are coming to the same domain they most likely
     // have the endpoint url saved in local storage. Replace it with new rome default endpoint.
-    if (settings.apiUrl == 'wss://testnet.joystream.org/acropolis/rpc/') {
+    if (settings.apiUrl === 'wss://testnet.joystream.org/acropolis/rpc/') {
       this._apiUrl = process.env.WS_URL || ENDPOINT_DEFAULT || 'wss://rome-rpc-endpoint.joystream.org:9944/';
     } else {
       this._apiUrl = settings.apiUrl || process.env.WS_URL || ENDPOINT_DEFAULT;

+ 1 - 1
pioneer/packages/joy-storage/src/ActorsList/index.tsx

@@ -48,7 +48,7 @@ class ActorInner extends React.PureComponent<ActorProps> {
 
     const actor = actorOpt.unwrap();
     const memberIsActor = iAmMember && myMemberId &&
-                            (myMemberId.toString() == actor.member_id.toString());
+                            (myMemberId.toString() === actor.member_id.toString());
 
     return (
       <Table.Row>

+ 1 - 1
pioneer/packages/joy-utils/src/MyAccount.tsx

@@ -159,7 +159,7 @@ const canUseAccount = (account: AccountId, allAccounts: SubjectInfo | undefined)
     return account.eq(allAccounts[key].json.address);
   });
 
-  return ix != -1;
+  return ix !== -1;
 };
 
 function withCurationActor<P extends MyAccountProps> (Component: React.ComponentType<P>) {

+ 1 - 1
pioneer/packages/joy-utils/src/accounts.ts

@@ -139,7 +139,7 @@ export function createAccount (suri: string, pairType: KeypairType, name: string
 }
 
 export function isPasswordValid (password: string): boolean {
-  return password.length == 0 || keyring.isPassValid(password);
+  return password.length === 0 || keyring.isPassValid(password);
 }
 
 export type MemberFromAccount = { account: string; id: number; profile?: Profile };

+ 1 - 1
pioneer/packages/joy-utils/src/memo/MemoEdit.tsx

@@ -59,7 +59,7 @@ class Component extends React.PureComponent<Props, State> {
     }
     this.setState({ memo });
 
-    if (storedMemo && memo == storedMemo.toString()) {
+    if (storedMemo && memo === storedMemo.toString()) {
       if (onReset) {
         onReset(memo);
       }