Update CompleteTimestamps.plugin.js

This commit is contained in:
Mirco Wittrien 2024-02-15 05:53:47 +01:00
parent 50f258aeca
commit 940b9ad6db
1 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@
* @name CompleteTimestamps * @name CompleteTimestamps
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.6.7 * @version 1.6.8
* @description Replaces Timestamps with your own custom Timestamps * @description Replaces Timestamps with your own custom Timestamps
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -190,13 +190,13 @@ module.exports = (_ => {
if (!tooltipWrapper) return; if (!tooltipWrapper) return;
let childClassName = BDFDB.ObjectUtils.get(e, "instance.props.children.props.className"); let childClassName = BDFDB.ObjectUtils.get(e, "instance.props.children.props.className");
if (childClassName && childClassName.indexOf(BDFDB.disCN.messageedited) > -1) { if (childClassName && childClassName.indexOf(BDFDB.disCN.messageedited) > -1) {
if (this.settings.tooltips.edit) tooltipWrapper.props.text = this.formatTimestamp(this.settings.dates.tooltipDate, e.instance.props.timestamp._i); if (this.settings.tooltips.edit) tooltipWrapper.props.text = this.formatTimestamp(this.settings.dates.tooltipDate, e.instance.props.timestamp._i || e.instance.props.timestamp);
} }
else { else {
if (!e.instance.props.cozyAlt) { if (!e.instance.props.cozyAlt) {
if (this.settings.places.chat) { if (this.settings.places.chat) {
if (tooltipIsSame) tooltipWrapper.props.delay = 99999999999999999999; if (tooltipIsSame) tooltipWrapper.props.delay = 99999999999999999999;
let timestamp = this.formatTimestamp(this.settings.dates.timestampDate, e.instance.props.timestamp._i); let timestamp = this.formatTimestamp(this.settings.dates.timestampDate, e.instance.props.timestamp._i || e.instance.props.timestamp);
let renderChildren = tooltipWrapper.props.children; let renderChildren = tooltipWrapper.props.children;
tooltipWrapper.props.children = BDFDB.TimeUtils.suppress((...args) => { tooltipWrapper.props.children = BDFDB.TimeUtils.suppress((...args) => {
let renderedChildren = renderChildren(...args); let renderedChildren = renderChildren(...args);
@ -209,7 +209,7 @@ module.exports = (_ => {
} }
} }
if (this.settings.tooltips.chat) { if (this.settings.tooltips.chat) {
let timestamp = this.formatTimestamp(this.settings.dates.tooltipDate, e.instance.props.timestamp._i); let timestamp = this.formatTimestamp(this.settings.dates.tooltipDate, e.instance.props.timestamp._i || e.instance.props.timestamp);
if (tooltipWrapper.props.text && tooltipWrapper.props.text.props && BDFDB.ArrayUtils.is(tooltipWrapper.props.text.props.children)) tooltipWrapper.props.text.props.children[0] = timestamp; if (tooltipWrapper.props.text && tooltipWrapper.props.text.props && BDFDB.ArrayUtils.is(tooltipWrapper.props.text.props.children)) tooltipWrapper.props.text.props.children[0] = timestamp;
else tooltipWrapper.props.text = timestamp; else tooltipWrapper.props.text = timestamp;
} }
@ -233,8 +233,8 @@ module.exports = (_ => {
let process = returnvalue => { let process = returnvalue => {
let [children, index] = BDFDB.ReactUtils.findParent(returnvalue, {props: [["className", BDFDB.disCN.embedfootertext]]}); let [children, index] = BDFDB.ReactUtils.findParent(returnvalue, {props: [["className", BDFDB.disCN.embedfootertext]]});
if (index > -1) { if (index > -1) {
if (BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children[children[index].props.children.length - 1] = this.formatTimestamp(this.settings.dates.timestampDate, e.instance.props.embed.timestamp._i); if (BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children[children[index].props.children.length - 1] = this.formatTimestamp(this.settings.dates.timestampDate, e.instance.props.embed.timestamp._i || e.instance.props.embed.timestamp);
else children[index].props.children = this.formatTimestamp(this.settings.dates.timestampDate, e.instance.props.embed.timestamp._i); else children[index].props.children = this.formatTimestamp(this.settings.dates.timestampDate, e.instance.props.embed.timestamp._i || e.instance.props.embed.timestamp);
} }
}; };
if (typeof e.returnvalue.props.children == "function") { if (typeof e.returnvalue.props.children == "function") {