Skip to content

Commit

Permalink
opti: update domain to x.com
Browse files Browse the repository at this point in the history
  • Loading branch information
zhbyak committed May 17, 2024
1 parent 6d3f222 commit 7a1b6e2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const XFANS_TWITTER_HOMEPAGE = 'https://twitter.com/BuidlerDAO';
export const XFANS_TWITTER_HOMEPAGE = 'https://x.com/BuidlerDAO';
export const XFANS_TWITTES =
'https://twitter.com/BuidlerDAO/status/1744712912537788860?xfans_check_retweet=1';
'https://x.com/BuidlerDAO/status/1744712912537788860?xfans_check_retweet=1';
export const XFANS_CHECK_RETWEET = 'xfans_check_retweet';
export const XFANS_TOKEN = 'xfans_token';
export const OAUTH2 = 'oauth2';
Expand Down
6 changes: 3 additions & 3 deletions src/content/drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ export default function PersistentDrawerRight() {

const initURLMonitor = () => {
// 定义您要监控的 URL
const switchUrl = 'https://api.twitter.com/1.1/account/multi/switch.json';
const logoutUrl = 'https://api.twitter.com/1.1/account/logout.json';
const taskUrl = 'https://api.twitter.com/1.1/account/task.json';
const switchUrl = 'https://api.x.com/1.1/account/multi/switch.json';
const logoutUrl = 'https://api.x.com/1.1/account/logout.json';
const taskUrl = 'https://api.x.com/1.1/account/task.json';

// 创建 PerformanceObserver
const observer = new PerformanceObserver((list) => {
Expand Down
6 changes: 5 additions & 1 deletion src/content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ withProxyStore(<Content />, store).then((component) => {

const doNotCheckPathList = ['notifications', 'messages', 'i'];
// 判断当前页面的 URL 是否符合一般的用户主页 URL 格式
if (currentUrl.includes('https://twitter.com/') && urlWordLength === 4 && lastWord === 'home') {
if (
(currentUrl.includes('https://twitter.com/') || currentUrl.includes('https://x.com/')) &&
urlWordLength === 4 &&
lastWord === 'home'
) {
return 'home';
} else if (urlWordLength === 4 && !doNotCheckPathList.includes(lastWord)) {
return 'userPage';
Expand Down
4 changes: 2 additions & 2 deletions src/welcome/Profile/Reward.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const Reward = () => {
className="cursor-pointer text-xs leading-[20px] text-black"
onClick={() => {
window.open(
`https://twitter.com/${item?.author?.twitterUsername}/status/${item?.id}`,
`https://x.com/${item?.author?.twitterUsername}/status/${item?.id}`,
'_blank'
);
}}
Expand Down Expand Up @@ -284,7 +284,7 @@ const Reward = () => {
className="cursor-pointer text-xs leading-[20px] text-black"
onClick={() => {
window.open(
`https://twitter.com/${item?.author?.twitterUsername}/status/${item?.id}`,
`https://x.com/${item?.author?.twitterUsername}/status/${item?.id}`,
'_blank'
);
}}
Expand Down
2 changes: 1 addition & 1 deletion src/welcome/Wallet/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ const ProfileModal = () => {
className="inline-block max-w-[200px] truncate hover:cursor-pointer"
onClick={() => {
const newTab = window.open(
`https://twitter.com/${currentInfo?.twitterUsername}/status/${currentInfo?.twitterId}`,
`https://x.com/${currentInfo?.twitterUsername}/status/${currentInfo?.twitterId}`,
'_blank'
);
newTab?.focus();
Expand Down

0 comments on commit 7a1b6e2

Please sign in to comment.