Skip to content

Commit

Permalink
fix: modify page judgment criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyantong2000 committed Aug 22, 2024
1 parent 66d49bc commit 882af81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/helpers/get-developer-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export function getDeveloperName() {
export async function isDeveloperWithMeta() {
return pageDetect.isUserProfile() && (await metaStore.has(getDeveloperName()));
}

export async function isUserProfile() {
return pageDetect.isUserProfile();
}
export function checkLogined() {
return !!$('meta[name="user-login"]').attr('content');
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import $ from 'jquery';
import elementReady from 'element-ready';

import features from '../../../../feature-manager';
import { isDeveloperWithMeta } from '../../../../helpers/get-developer-info';
import { isUserProfile } from '../../../../helpers/get-developer-info';
import View from './view';

const featureId = features.getFeatureID(import.meta.url);
Expand Down Expand Up @@ -34,7 +34,7 @@ const restore = async () => {
};

features.add(featureId, {
asLongAs: [isDeveloperWithMeta],
asLongAs: [isUserProfile],
awaitDomReady: false,
init,
restore,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ContentScripts/features/repo-networks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const restore = async () => {
};

features.add(featureId, {
asLongAs: [isPerceptor, isPublicRepoWithMeta],
asLongAs: [isPerceptor],
awaitDomReady: false,
init,
restore,
Expand Down

0 comments on commit 882af81

Please sign in to comment.