Skip to content
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
8 changes: 6 additions & 2 deletions src/helpers/get-gitee-repo-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { metaStore } from '../api/common';
import $ from 'jquery';
import * as pageDetect from 'github-url-detection';
import { getPlatform } from './get-platform';
import elementReady from 'element-ready';

export function getRepoName() {
const repoNameByUrl = getRepoNameByUrl();
Expand All @@ -24,8 +25,11 @@ export function hasRepoContainerHeader() {
* check if the repository is public
*/
export async function isPublicRepo() {
const elements = $('.project-icon.iconfont');
return elements.hasClass('icon-project-public');
const elements = await elementReady('.gitee-project-extension .extension.public');
if (!elements) {
return false;
}
return $(elements).text().trim() === '1';
}
export async function isPublicRepoWithMeta() {
const platform = getPlatform();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const init = async (): Promise<void> => {
container.className = 'inline-label-container';
renderTo(container);
await elementReady('.git-project-header-container');
$('.git-project-header-container').find('span.project-title').after(container);
$('.git-project-header-container .repository').after(container);
await waitForElement('#activity-header-label');
await waitForElement('#OpenRank-header-label');
await waitForElement('#participant-header-label');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const View = ({ activity, openrank, participant, contributor, meta }: Props): JS
const rocketDarkLogo = chrome.runtime.getURL('rocketDarkLogo.png');
const textColor = isGithub() ? (theme === 'light' ? '#24292F' : '#C9D1D9') : '#40485B';
return (
<div className="d-flex">
<div className={isGithub() ? 'd-flex' : ''}>
<span
id="activity-header-label"
className="Label Label--secondary v-align-middle mr-1 unselectable"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const init = async (): Promise<void> => {
platform = getPlatform();
repoName = getRepoName();
await getData();

if (Object.keys(PRDetail.mergedCodeAddition || {}).length === 0) {
PRDetail.mergedCodeAddition = null;
}
Expand Down
Loading