// Copyright (c) 2021, JINGROW
// For license information, please see license.txt

jingrow.ui.form.on('Marketplace App Subscription', {
	refresh: function (frm) {
		if (frm.pg.status != 'Active') {
			frm.add_custom_button(
				__('Activate'),
				() => {
					frm.call('activate').then(() => {
						jingrow.msgprint({
							title: 'Subscription Activated successfully.',
							indicator: 'green',
						});
						frm.refresh();
					});
				},
				'Actions',
			);
		}
	},
});
