Path aliases, better lazyWebpack (#268)
This commit is contained in:
parent
7a4402f142
commit
bad96b7887
138 changed files with 572 additions and 547 deletions
|
|
@ -16,43 +16,43 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Link } from "../components/Link";
|
||||
import { Devs } from "../utils/constants";
|
||||
import { lazyWebpack } from "../utils/misc";
|
||||
import definePlugin, { OptionType } from "../utils/types";
|
||||
import { Settings, Webpack } from "../Vencord";
|
||||
import { FluxDispatcher, Forms } from "../webpack/common";
|
||||
import { Settings } from "@api/settings";
|
||||
import { Link } from "@components/Link";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { filters, findByPropsLazy, mapMangledModuleLazy } from "@webpack";
|
||||
import { FluxDispatcher, Forms } from "@webpack/common";
|
||||
|
||||
interface ActivityAssets {
|
||||
large_image?: string
|
||||
large_text?: string
|
||||
small_image?: string
|
||||
small_text?: string
|
||||
large_image?: string;
|
||||
large_text?: string;
|
||||
small_image?: string;
|
||||
small_text?: string;
|
||||
}
|
||||
|
||||
interface Activity {
|
||||
state: string
|
||||
details?: string
|
||||
state: string;
|
||||
details?: string;
|
||||
timestamps?: {
|
||||
start?: Number
|
||||
}
|
||||
assets?: ActivityAssets
|
||||
buttons?: Array<string>
|
||||
name: string
|
||||
application_id: string
|
||||
start?: Number;
|
||||
};
|
||||
assets?: ActivityAssets;
|
||||
buttons?: Array<string>;
|
||||
name: string;
|
||||
application_id: string;
|
||||
metadata?: {
|
||||
button_urls?: Array<string>
|
||||
}
|
||||
type: Number
|
||||
flags: Number
|
||||
button_urls?: Array<string>;
|
||||
};
|
||||
type: Number;
|
||||
flags: Number;
|
||||
}
|
||||
|
||||
interface TrackData {
|
||||
name: string
|
||||
album: string
|
||||
artist: string
|
||||
url: string
|
||||
imageUrl?: string
|
||||
name: string;
|
||||
album: string;
|
||||
artist: string;
|
||||
url: string;
|
||||
imageUrl?: string;
|
||||
}
|
||||
|
||||
// only relevant enum values
|
||||
|
|
@ -67,11 +67,11 @@ enum ActivityFlag {
|
|||
|
||||
const applicationId = "1043533871037284423";
|
||||
|
||||
const presenceStore = lazyWebpack(Webpack.filters.byProps("getLocalPresence"));
|
||||
const assetManager = Webpack.mapMangledModuleLazy(
|
||||
const presenceStore = findByPropsLazy("getLocalPresence");
|
||||
const assetManager = mapMangledModuleLazy(
|
||||
"getAssetImage: size must === [number, number] for Twitch",
|
||||
{
|
||||
getAsset: Webpack.filters.byCode("apply("),
|
||||
getAsset: filters.byCode("apply("),
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -196,9 +196,9 @@ export default definePlugin({
|
|||
state: hideAlbumName ? trackData.artist : `${trackData.artist} - ${trackData.album}`,
|
||||
assets,
|
||||
|
||||
buttons: [ "Open in Last.fm" ],
|
||||
buttons: ["Open in Last.fm"],
|
||||
metadata: {
|
||||
button_urls: [ trackData.url ]
|
||||
button_urls: [trackData.url]
|
||||
},
|
||||
|
||||
type: this.settings.useListeningStatus ? ActivityType.LISTENING : ActivityType.PLAYING,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue