Bläddra i källkod

feature: show error if open modal doesn't exist as a type

Kristian Vos 1 månad sedan
förälder
incheckning
2a4045234b
1 ändrade filer med 27 tillägg och 0 borttagningar
  1. 27 0
      frontend/src/components/ModalManager.vue

+ 27 - 0
frontend/src/components/ModalManager.vue

@@ -44,6 +44,33 @@ const modalComponents = shallowRef(
 				:modal-uuid="activeModalUuid"
 				v-bind="modals[activeModalUuid].props"
 			/>
+			<div
+				v-if="!modalComponents[modals[activeModalUuid].modal]"
+				class="modal-error"
+			>
+				<p>
+					Modal "{{ modals[activeModalUuid].modal }}" does not exist
+				</p>
+			</div>
 		</div>
 	</div>
 </template>
+
+<style lang="less" scoped>
+.modal-error {
+	position: absolute;
+	bottom: 0;
+	left: 0;
+	width: 100%;
+	background-color: var(--dark-red);
+	color: var(--white);
+	z-index: 10000;
+	padding: 32px;
+
+	p {
+		padding: 0;
+		margin: 0;
+		font-size: 3em;
+	}
+}
+</style>