Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confirm dialogue not working as it did in previous versions #3091

Closed
2 tasks done
ohitstom opened this issue Jul 4, 2024 · 5 comments
Closed
2 tasks done

confirm dialogue not working as it did in previous versions #3091

ohitstom opened this issue Jul 4, 2024 · 5 comments
Labels

Comments

@ohitstom
Copy link
Contributor

ohitstom commented Jul 4, 2024

πŸ” Have you checked Spicetify.app page for your issue?

  • I have checked the FAQ

πŸ” Is there already an issue for your problem?

  • I have checked older issues, open and closed

β„Ή Environment / Computer Info

Spotify for Windows (64 bit)
1.2.41.434.g39a25e2c
Spicetify v2.36.14
Theme: Comfy / Comfy
Extensions: npvAmbience.js, toggleDJ.js, gamepad.js, spotifyBackup.js, playbarClock.js, quickQueue.js, scannables.js, sleepTimer.js, tracksToEdges.js, adblock.js, immersiveView.js, volumePercentage.js
Custom apps: lyrics-plus, new-releases, marketplace
xpui_2024-06-28_1719586782170_39a25e2
cef_125.0.19+g3d8f1c9+chromium-125.0.6422.112
Runtime: Chrome
Build System: CMake

πŸ“ Description

Is it no longer a function and now a symbol? if so how can i make my old code work with it - or is this not intended

const Dialog = Spicetify.React.memo(props => {
const [state, setState] = Spicetify.React.useState(true);
const self = document.querySelector(".ReactModalPortal:last-of-type");

Spicetify.React.useEffect(() => {
	if (state) {
		props.onOpen?.();
	}
}, [state]);

return Spicetify.ReactComponent.ConfirmDialog({
	...props,
	isOpen: state,
	onClose: () => {
		setState(false);
		props.onClose();
		self.remove();
	},
	onConfirm: () => {
		setState(false);
		props.onConfirm();
		self.remove();
	}
});
});

πŸ“Έ Screenshots

image

@ohitstom ohitstom added the πŸ› bug Something isn't working label Jul 4, 2024
@rxri
Copy link
Member

rxri commented Jul 4, 2024

ConfirmDialog is a JSX component. Blame Spotify for making it different

@rxri rxri closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2024
@ohitstom
Copy link
Contributor Author

ohitstom commented Jul 4, 2024

ConfirmDialog is a JSX component. Blame Spotify's for making it different

does this mean i can just do Spicetify.ReactComponent.ConfirmDialog.render({}) in its place?

ah just gotta wrap it in a new createElement, thanks for the help :)

@rxri
Copy link
Member

rxri commented Jul 4, 2024

Use React to create the element with this component

@Delusoire

This comment has been minimized.

@ohitstom

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants