export function runWhenReadyWithRetry(
	isTrue: () => boolean,
	func: () => void,
	retry: number = 0
): void {
	if (isTrue()) {
		func();
	} else {
		if (!retry || retry < 9) {
			setTimeout(() => {
				runWhenReadyWithRetry(isTrue, func, retry++);
			}, 500);
		}
	}
}
