Skip to content

Commit afbaaa2

Browse files
authored
fix: isTrustedRepo method (#1411)
Signed-off-by: Oleksii Orel <[email protected]>
1 parent d82d2b8 commit afbaaa2

File tree

1 file changed

+4
-7
lines changed
  • packages/dashboard-frontend/src/store/Workspaces/Preferences

1 file changed

+4
-7
lines changed

packages/dashboard-frontend/src/store/Workspaces/Preferences/helpers.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,9 @@ export function isTrustedRepo(
122122
const trustedUrlPattern = getRepoPattern(trustedUrl);
123123
const trustedUrlRepo = extractRepo(trustedUrl, trustedUrlPattern);
124124

125-
if (urlRepo !== null && trustedUrlRepo !== null) {
126-
// compare repository names
127-
return urlRepo === trustedUrlRepo;
128-
} else {
129-
// compare URLs as is
130-
return urlString === trustedUrl;
131-
}
125+
return (
126+
(urlRepo && trustedUrlRepo && urlRepo === trustedUrlRepo) ||
127+
urlString.split('?')[0] === trustedUrl.split('?')[0]
128+
);
132129
});
133130
}

0 commit comments

Comments
 (0)