1- import { Patcher , ReactUtils , UI } from "@api" ;
2- import * as ContextMenus from "./menus" ;
3- import Styles from "@styles" ;
4- import Webpack , { Tooltip } from "./modules/webpack" ;
5- import { copy , findInTree , onceAdded } from "./modules/utils" ;
6- import config from "@manifest" ;
7- import React from "react" ;
8- import CopyIcon from "./components/icons/copy" ;
9-
101import "./button.css" ;
112import "./changelog.css" ;
3+
4+ import React from "react" ;
5+
6+ import { Patcher , ReactUtils } from "@api" ;
7+ import manifest from "@manifest" ;
8+ import Styles from "@styles" ;
9+
10+ import showChangelog from "../common/Changelog" ;
1211import CopyButton from "./components/copybutton" ;
1312import SettingsPanel from "./components/settings" ;
14- import Settings from "./modules/settings" ;
13+ import * as ContextMenus from "./menus" ;
14+ import Webpack , { Tooltip } from "./modules/webpack" ;
15+ import { findInTree , onceAdded } from "./modules/utils" ;
16+ import CopyIcon from "./components/icons/copy" ;
1517
1618export default class Copier {
1719 flush = new Set ( ) ;
18-
19- maybeShowChangelog ( ) {
20- if ( config . version === Settings . get ( "latestUsedVersion" ) ) return ;
21-
22- const items = config . changelog . map ( item => (
23- < div className = { "copier-changelog-item " + "item-changelog-" + item . type } >
24- < h4 className = "copier-changelog-header" > { item . type } </ h4 >
25- { item . items . map ( i => < span > { i } </ span > ) }
26- </ div >
27- ) ) ;
28-
29- "changelogImage" in config && items . unshift (
30- < img className = "copier-changelog-banner" src = { config . changelogImage } />
31- ) ;
32-
33- Settings . set ( "latestUsedVersion" , config . version ) ;
34-
35- const formatter = new Intl . DateTimeFormat ( document . documentElement . lang , { month : "long" , day : "numeric" , year : "numeric" } ) ;
36- UI . alert ( < div className = "copier-title-wrap" >
37- < h1 > What's New - { config . name } </ h1 >
38- < span > { formatter . format ( new Date ( config . changelogDate ) ) } </ span >
39- </ div > , items ) ;
40- }
41-
4220 getSettingsPanel ( ) {
4321 return (
4422 < SettingsPanel />
4523 ) ;
4624 }
4725
4826 start ( ) {
49- this . controller = new AbortController ( ) ;
5027 Styles . load ( ) ;
28+ showChangelog ( manifest ) ;
29+ this . controller = new AbortController ( ) ;
5130
5231 for ( const id in ContextMenus ) {
5332 try {
@@ -58,13 +37,12 @@ export default class Copier {
5837 }
5938 }
6039
61- this . patchAboutMe ( ) ;
40+ // this.patchAboutMe();
6241 this . patchToolbar ( ) ;
63- this . maybeShowChangelog ( ) ;
6442 }
6543
6644 patchAboutMe ( ) {
67- const [ module , key ] = Webpack . getMangled ( m => m ?. toString ?. ( ) . includes ( "USER_POPOUT_ABOUT_ME" ) ) ;
45+ const module = Webpack . getBySource ( [ 'animUserProfileSidebarateOnHoverOrFocusOnly' , '61W33d' ] )
6846
6947 const CopyButton = React . memo ( ( { onClick} ) => (
7048 < Tooltip text = "Copy About Me" tooltipClassName = "copier-tooltip" position = "top" >
@@ -76,7 +54,8 @@ export default class Copier {
7654 </ Tooltip >
7755 ) ) ;
7856
79- Patcher . after ( module , key , ( _ , [ { bio} ] , res ) => {
57+ Patcher . after ( module , "Z" , ( _ , [ { bio} ] , res ) => {
58+ console . log ( res )
8059 const title = findInTree ( res , e => e ?. variant && Array . isArray ( e . children ) ) ;
8160
8261 if ( ! title ) return res ; ;
0 commit comments