This commit is contained in:
Zack Rauen 2020-04-28 03:11:45 -04:00
parent b348def5fa
commit ddeef1acae
4 changed files with 8 additions and 13 deletions

File diff suppressed because one or more lines are too long

2
js/main.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -78,16 +78,7 @@ BdApi.getCore = function () {
* @param {string} content - a string of text to display in the modal
*/
BdApi.alert = function (title, content) {
const ModalStack = BdApi.findModuleByProps("push", "update", "pop", "popWithKey");
const AlertModal = BdApi.findModuleByPrototypes("handleCancel", "handleSubmit", "handleMinorConfirm");
if (!ModalStack || !AlertModal) return mainCore.alert(title, content);
ModalStack.push(function(props) {
return BdApi.React.createElement(AlertModal, Object.assign({
title: title,
body: content,
}, props));
});
Utils.showConfirmationModal(title, content, {cancelText: null});
};
/**

View File

@ -199,6 +199,10 @@ Core.prototype.showChangelogModal = function(options = {}) {
return Utils.showChangelogModal(options);
};
Core.prototype.alert = function(title, content) {
return Utils.alert(title, content);
};
Core.prototype.patchSocial = function() {
if (this.socialPatch) return;
const TabBar = WebpackModules.find(m => m.displayName == "TabBar");