HideGiftButton: use findByName
This commit is contained in:
parent
14ee13b281
commit
7ac23a90c2
1 changed files with 5 additions and 5 deletions
|
|
@ -1,17 +1,17 @@
|
||||||
import { logger } from "@vendetta";
|
import { logger } from "@vendetta";
|
||||||
import { findByDisplayName } from "@vendetta/metro";
|
import { find } from "@vendetta/metro";
|
||||||
|
|
||||||
let origState: boolean;
|
const ChatInput = find((m) => typeof m?.defaultProps?.hideGiftButton === "boolean");
|
||||||
const ChatInput = findByDisplayName("ChatInput");
|
|
||||||
|
|
||||||
export default new class HideGiftButton {
|
export default new class HideGiftButton {
|
||||||
|
origState: boolean;
|
||||||
onLoad() {
|
onLoad() {
|
||||||
logger.log("Starting HideGiftButton...");
|
logger.log("Starting HideGiftButton...");
|
||||||
origState = ChatInput.defaultProps.hideGiftButton;
|
this.origState = ChatInput.defaultProps.hideGiftButton;
|
||||||
ChatInput.defaultProps.hideGiftButton = true;
|
ChatInput.defaultProps.hideGiftButton = true;
|
||||||
}
|
}
|
||||||
onUnload() {
|
onUnload() {
|
||||||
logger.log("Unloading HideGiftButton..");
|
logger.log("Unloading HideGiftButton..");
|
||||||
ChatInput.defaultProps.hideGiftButton = origState;
|
ChatInput.defaultProps.hideGiftButton = this.origState;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue